Skip to content

Commit

Permalink
words only used in one test, so no need to load the list for every te…
Browse files Browse the repository at this point in the history
…st with a setUp
  • Loading branch information
pybites committed Jan 8, 2017
1 parent a63c7d6 commit c1fca93
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions 01/test_wordvalue.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@

class TestWordValue(unittest.TestCase):

def setUp(self):
self.words = load_words()

def test_load_words(self):
self.assertEqual(len(self.words), 235886)
self.assertEqual(self.words[0], 'A')
self.assertEqual(self.words[-1], 'Zyzzogeton')
self.assertNotIn(' ', ''.join(self.words))
words = load_words()
self.assertEqual(len(words), 235886)
self.assertEqual(words[0], 'A')
self.assertEqual(words[-1], 'Zyzzogeton')
self.assertNotIn(' ', ''.join(words))

def test_calc_word_value(self):
self.assertEqual(calc_word_value('bob'), 7)
Expand Down

0 comments on commit c1fca93

Please sign in to comment.