def test_stat_addition(self): kota_stats = Stats(KOTA_STATS) luke_stats = Stats(LUKE_STATS) self.assertEqual(kota_stats.get_value('Contract'), KOTA_STATS['Contract']) self.assertEqual(luke_stats.get_value('Contract'), LUKE_STATS['Contract']) stat_sum = kota_stats + luke_stats self.assertEqual(stat_sum.get_value('Contract'), KOTA_STATS['Contract'] + LUKE_STATS['Contract']) self.assertEqual(luke_stats.get_value('Contract'), LUKE_STATS['Contract']) self.assertEqual(kota_stats.get_value('Contract'), KOTA_STATS['Contract'])
def filter_rd_and_exploration(self): my_dict = { 'Tech': 1, 'Contract': 4, 'Artifact': 3, 'Fragment': 2, 'Memento': 3 } stat = Stats(my_dict) self.assertEqual(stat.get_value('Tech'), 1) self.assertEqual(stat.get_value('Memento'), 3) self.assertEqual(stat.filter_rd().get_value('Tech'), 1) self.assertEqual(stat.filter_rd().get_value('Memento'), 0) self.assertEqual(stat.filter_exploration().get_value('Tech'), 0) self.assertEqual(stat.filter_exploration().get_value('Memento'), 3)
def test_stats_initialize_empty(self): new_stats = Stats() self.assertEqual(new_stats.get_value('Danger'), 0)
def test_stats_initialize_not_empty(self): new_stats = Stats(KOTA_STATS) self.assertEqual(new_stats.get_value('Contract'), KOTA_STATS['Contract'])