Skip to content

Commit bdd0cf0

Browse files
committed
Update import statements and modify test and challenge files to accommodate those updated import statements
1 parent cfd601c commit bdd0cf0

File tree

36 files changed

+47
-95
lines changed

36 files changed

+47
-95
lines changed

challenges/1.3.Input/lesson_tests.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import unittest
2-
import lesson_code
2+
from main import *
33

44
class InputTests(unittest.TestCase):
55
def test_main(self):
6-
name = lesson_code.Name
7-
age = lesson_code.Age
8-
96
self.assertIsInstance(name, str)
107
self.assertIsInstance(age, str)
118
# To run the tests from the console:
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import unittest
2-
import lesson_code
2+
from main import *
33

44
class NumbersTests(unittest.TestCase):
55
def test_main(self):
6-
myInteger = lesson_code.myInteger
7-
myFloat = lesson_code.myFloat
8-
myComplex = lesson_code.myComplex
96
self.assertIsInstance(myInteger, int)
107
self.assertIsInstance(myFloat, float)
118
self.assertIsInstance(myComplex, complex)

challenges/2.2.Strings/lesson_tests.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
import unittest
2-
import lesson_code
2+
from main import *
33

44
class StringsTests(unittest.TestCase):
55
def test_main(self):
6-
myName = lesson_code.myName
7-
myAge = lesson_code.myAge
8-
favoriteActivity = lesson_code.favoriteActivity
9-
mySentence = lesson_code.mySentence
106
self.assertIsInstance(myName, str)
117
self.assertIsInstance(myAge, str)
128
self.assertIsInstance(favoriteActivity, str)
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
import unittest
2-
import lesson_code
2+
from main import *
33

44
class StringsTests(unittest.TestCase):
55
def test_main(self):
6-
twoTuple = lesson_code.twoTuple
7-
threeTuple = lesson_code.threeTuple
8-
fiveTuple = lesson_code.fiveTuple
9-
tenTuple = lesson_code.tenTuple
106
self.assertIsInstance(twoTuple, tuple)
117
self.assertIsInstance(threeTuple, tuple)
128
self.assertIsInstance(fiveTuple, tuple)
@@ -15,4 +11,3 @@ def test_main(self):
1511
self.assertEqual(len(threeTuple), 3)
1612
self.assertEqual(len(fiveTuple), 5)
1713
self.assertEqual(len(tenTuple), 10)
18-
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
import unittest
2-
import lesson_code
2+
from main import *
33

44
class StringsTests(unittest.TestCase):
55
def test_main(self):
6-
mediumList = lesson_code.mediumList
7-
shortList = lesson_code.shortList
8-
longList = lesson_code.longList
9-
106
self.assertIsInstance(mediumList, list)
117
self.assertIsInstance(shortList, list)
128
self.assertIsInstance(longList, list)
13-
149
self.assertEqual(len(mediumList), 5)
1510
self.assertEqual(len(shortList), 2)
1611
self.assertEqual(len(longList), 7)
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import unittest
2-
import lesson_code
2+
from main import *
33

44
class StringsTests(unittest.TestCase):
55
def test_main(self):
6-
fccSet = lesson_code.fccSet
7-
86
self.assertIsInstance(fccSet, set)
97
self.assertEqual(len(fccSet), 14)
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import unittest
2-
import lesson_code
2+
from main import *
33

44
class AssignmentOperatorTests(unittest.TestCase):
55
def test_main(self):
6-
my_name = lesson_code.my_name
76
self.assertIsNotNone(my_name)
87
self.assertIsInstance(my_name, str)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import unittest
2-
from lesson_code import equality
2+
from main import *
33

44
class EqualityOperatorTests(unittest.TestCase):
55
def test_main(self):
@@ -9,7 +9,7 @@ def test_main(self):
99
self.assertNotEqual(equality(12), 'Not Equal to 12')
1010

1111
def test_operator_presence(self):
12-
f = open('lesson_code.py')
12+
f = open('main.py')
1313
lines = str(f.readlines())
1414
f.close()
1515
self.assertRegex(lines, '==', msg="The == operator is not in the function definition")
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import unittest
2-
from inequality_operator_code import inequality
2+
from main import *
33

44
class InEqualityOperatorTests(unittest.TestCase):
55
def test_main(self):
@@ -9,7 +9,7 @@ def test_main(self):
99
self.assertNotEqual(inequality(13), 'Not Equal to 13')
1010

1111
def test_operator_presence(self):
12-
f = open('inequality_operator_code.py')
12+
f = open('main.py')
1313
lines = str(f.readlines())
1414
f.close()
1515
self.assertRegex(lines, '!=', msg="The != operator is not in the function definition")

challenges/3.4.Strictly_Less_Than_Operator/lesson_tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import unittest
2-
from lesson_code import strictly_less_than
2+
from main import *
33

44
class StrictlyLessThanOperatorTests(unittest.TestCase):
55
def test_main(self):
@@ -13,7 +13,7 @@ def test_main(self):
1313
self.assertEqual(strictly_less_than(110), "100 or more")
1414

1515
def test_operator_presence(self):
16-
f = open('lesson_code.py')
16+
f = open('main.py')
1717
lines = str(f.readlines())
1818
f.close()
1919
self.assertRegex(lines, '<', msg="The < operator is not in the function definition")

0 commit comments

Comments
 (0)