-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
46d3939
commit 0236a45
Showing
10 changed files
with
170 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 13 additions & 9 deletions
22
staging/arrays_strings/reverse_words/reverse_words_solution.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
from nose.tools import assert_equal | ||
import unittest | ||
|
||
|
||
class TestReverseWords(unittest.TestCase): | ||
|
||
class UnitTest (object): | ||
def testReverseWords(self, func): | ||
assert_equal(func('the sun is hot'), 'eht nus si toh') | ||
assert_equal(func(''), None) | ||
assert_equal(func('123 456 789'), '321 654 987') | ||
assert_equal(func('magic'), 'cigam') | ||
self.assertEqual(func('the sun is hot'), 'eht nus si toh') | ||
self.assertEqual(func(''), None) | ||
self.assertEqual(func('123 456 789'), '321 654 987') | ||
self.assertEqual(func('magic'), 'cigam') | ||
print('Success: reverse_words') | ||
|
||
|
||
|
||
def main(): | ||
test = UnitTest() | ||
test = TestReverseWords() | ||
test.testReverseWords(reverse_words) | ||
|
||
|
||
if __name__=="__main__": | ||
main() | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.