-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
33 additions
and
158 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
### Как да проверя домашното? | ||
|
||
1. Изтегли всички файлове. | ||
2. Напиш домашното. | ||
3. Стартирай файла `tests.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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import unittest | ||
import logging | ||
|
||
def warn_if_not_implemented(func): | ||
def wrapper(*args, **kwargs): | ||
try: | ||
func(*args, **kwargs) | ||
except Exception as e: | ||
if e.args[0] == 'Not implemented': | ||
logging.warning('%s is not implemented' % func.__name__[len('test_'):]) | ||
return | ||
raise | ||
|
||
return wrapper | ||
|
||
|
||
class TestTasks(unittest.TestCase): | ||
|
||
@warn_if_not_implemented | ||
def test_xor(self): | ||
from xor import xor | ||
self.assertEqual(xor(False, False), False) | ||
self.assertEqual(xor(False, True), True) | ||
self.assertEqual(xor(True, False), True) | ||
self.assertEqual(xor(True, True), False) | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |
File renamed without changes.
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