Update it all, VisualStudio Changes
This commit is contained in:
2
python/example/example.py
Normal file
2
python/example/example.py
Normal file
@@ -0,0 +1,2 @@
|
||||
def add(x, y):
|
||||
return x + y
|
36
python/example/example_test.py
Normal file
36
python/example/example_test.py
Normal file
@@ -0,0 +1,36 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import unittest
|
||||
|
||||
import example
|
||||
|
||||
|
||||
class ExampleTests(unittest.TestCase):
|
||||
|
||||
def test_add_2_and_2(self):
|
||||
self.assertEqual(
|
||||
4,
|
||||
example.add(2, 2)
|
||||
)
|
||||
|
||||
def test_add_12_and_24(self):
|
||||
self.assertEqual(
|
||||
36,
|
||||
example.add(12, 24)
|
||||
)
|
||||
|
||||
def test_add_100_and_1(self):
|
||||
self.assertEqual(
|
||||
101,
|
||||
example.add(100, 1)
|
||||
)
|
||||
|
||||
def test_add_2_and_minus_2(self):
|
||||
self.assertEqual(
|
||||
0,
|
||||
example.add(2, -2)
|
||||
)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
Reference in New Issue
Block a user