Skip to content

Commit

Permalink
version 0.2 commit
Browse files Browse the repository at this point in the history
  • Loading branch information
akshaynagpal committed May 7, 2016
1 parent bebc681 commit 54fd145
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ def open_file(fname):
setup(
name = 'word2number',
packages = ['word2number'], # this must be the same as the name above
version = '0.1',
version = '0.2',
license=open('LICENSE.txt').read(),
description = 'Convert number words(eg. three hundred and forty two) to numbers(342).',
author = 'Akshay Nagpal',
author_email = 'akshay2626@gmail.com',
url = 'https://github.com/akshaynagpal/w2n', # use the URL to the github repo
download_url = 'https://github.com/akshaynagpal/w2n/tarball/0.1', # I'll explain this in a second
download_url = 'https://github.com/akshaynagpal/w2n/tarball/0.2', # I'll explain this in a second
keywords = ['numbers', 'convert', 'words'], # arbitrary keywords
classifiers = [
'Intended Audience :: Developers',
Expand Down
18 changes: 18 additions & 0 deletions unit_testing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import unittest
import w2n

class TestW2N(unittest.TestCase):

def test_output(self):
self.assertEqual(w2n.word_to_num("two million three thousand nine hundred and eighty four"),2003984)
self.assertEqual(w2n.word_to_num("nineteen"),19)
self.assertEqual(w2n.word_to_num('three billion'),3000000000)
self.assertEqual(w2n.word_to_num('three million'),3000000)
self.assertEqual(w2n.word_to_num('one hundred twenty three million four hundred fifty six thousand seven hundred and eighty nine')
,123456789)
self.assertEqual(w2n.word_to_num('eleven'),11)
self.assertEqual(w2n.word_to_num('nineteen billion and nineteen'),19000000019)
self.assertEqual(w2n.word_to_num('one hundred and forty two'),142)

if __name__ == '__main__':
unittest.main()
18 changes: 18 additions & 0 deletions word2number/unit_testing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import unittest
from word2number import w2n

class TestW2N(unittest.TestCase):

def test_output(self):
self.assertEqual(w2n.word_to_num("two million three thousand nine hundred and eighty four"),2003984)
self.assertEqual(w2n.word_to_num("nineteen"),19)
self.assertEqual(w2n.word_to_num('three billion'),3000000000)
self.assertEqual(w2n.word_to_num('three million'),3000000)
self.assertEqual(w2n.word_to_num('one hundred twenty three million four hundred fifty six thousand seven hundred and eighty nine')
,123456789)
self.assertEqual(w2n.word_to_num('eleven'),11)
self.assertEqual(w2n.word_to_num('nineteen billion and nineteen'),19000000019)
self.assertEqual(w2n.word_to_num('one hundred and forty two'),142)

if __name__ == '__main__':
unittest.main()

0 comments on commit 54fd145

Please sign in to comment.