Last active
January 5, 2019 21:54
-
-
Save pony012/3e1c81fbb2f0a41234d1a6864c54d249 to your computer and use it in GitHub Desktop.
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
def largest_element(elements): | |
pass |
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
---------------------------------------------------------------------- | |
Ran 4 tests in 0.006s | |
FAILED (failures=3) | |
test_largest_element (test_first.Test_TestIncrementDecrement) ... FAIL | |
NoneType: None | |
test_largest_element_negatives (test_first.Test_TestIncrementDecrement) ... FAIL | |
NoneType: None | |
test_largest_element_single (test_first.Test_TestIncrementDecrement) ... FAIL | |
NoneType: None | |
test_largest_element_void (test_first.Test_TestIncrementDecrement) ... ok | |
====================================================================== | |
FAIL: test_largest_element (test_first.Test_TestIncrementDecrement) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/Users/alan/Documentos/Nes/01/test_first.py", line 6, in test_largest_element | |
self.assertEqual(first.largest_element([1, -1, 2, 4]), 4) | |
AssertionError: None != 4 | |
====================================================================== | |
FAIL: test_largest_element_negatives (test_first.Test_TestIncrementDecrement) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/Users/alan/Documentos/Nes/01/test_first.py", line 8, in test_largest_element_negatives | |
self.assertEqual(first.largest_element([-1, -1, -2, -4]), -1) | |
AssertionError: None != -1 | |
====================================================================== | |
FAIL: test_largest_element_single (test_first.Test_TestIncrementDecrement) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/Users/alan/Documentos/Nes/01/test_first.py", line 10, in test_largest_element_single | |
self.assertEqual(first.largest_element([0]), 0) | |
AssertionError: None != 0 | |
---------------------------------------------------------------------- | |
Ran 4 tests in 0.003s | |
FAILED (failures=3) |
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
import unittest | |
import first | |
class Test_TestIncrementDecrement(unittest.TestCase): | |
def test_largest_element(self): | |
self.assertEqual(first.largest_element([1, -1, 2, 4]), 4) | |
def test_largest_element_negatives(self): | |
self.assertEqual(first.largest_element([-1, -1, -2, -4]), -1) | |
def test_largest_element_single(self): | |
self.assertEqual(first.largest_element([0]), 0) | |
def test_largest_element_void(self): | |
self.assertEqual(first.largest_element([]), None) | |
if __name__ == '__main__': | |
unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment