def test_word_storage_put_existing(self): """existing word is not added to storage""" word_storage = WordStorage() word = 'word' word_storage.storage = {'word': 1} word_storage.put(word) self.assertEqual(word_storage.storage, {'word': 1})
def test_word_storage_put_word_none(self): """none is not added to storage""" word_storage = WordStorage() word = None word_storage.put(word) self.assertEqual(word_storage.storage, {})
def test_word_storage_put_word_not_str(self): """non string word is not added to storage""" word_storage = WordStorage() word = 123 word_storage.put(word) self.assertEqual(word_storage.storage, {})
def test_word_storage_put_ideal(self): """word is added to storage""" word_storage = WordStorage() word = 'word' num = word_storage.put(word) self.assertEqual(word_storage.storage[word], num)