Exemplo n.º 1
0
 def setUp(self):
     self.manager = FilterAchievementManager(
         '-builtin:night-shift,'
         '-builtin:punctuality', BuiltinAchievementManager)
     self.manager.load()
     self.builtin_manager = BuiltinAchievementManager()
     self.builtin_manager.load()
Exemplo n.º 2
0
class TestBuiltinAchievementManager(unittest.TestCase):
    def setUp(self):
        self.manager = BuiltinAchievementManager()
        self.manager.load()

    def test_includes_all_builtin_achievements(self):
        for name in noseachievements.achievements.builtin.__all__:
            achievement = getattr(noseachievements.achievements.builtin, name)()
            self.assertTrue(achievement in self.manager)
Exemplo n.º 3
0
class TestFilterAchievementManagerAll(unittest.TestCase):
    def setUp(self):
        self.manager = FilterAchievementManager('all', BuiltinAchievementManager)
        self.manager.load()
        self.builtin_manager = BuiltinAchievementManager()
        self.builtin_manager.load()

    def test_builtin_filter_includes_all_builtin_achievements(self):
        self.assertEqual(set(self.manager.achievements),
                         set(self.builtin_manager.achievements))
Exemplo n.º 4
0
class TestFilterAchievementManagerExclude(unittest.TestCase):
    def setUp(self):
        self.manager = FilterAchievementManager(
            '-builtin:night-shift,'
            '-builtin:punctuality', BuiltinAchievementManager)
        self.manager.load()
        self.builtin_manager = BuiltinAchievementManager()
        self.builtin_manager.load()

    def test_achievements_are_excluded(self):
        achievements = set(self.builtin_manager.achievements)
        achievements.discard('builtin:night-shift')
        achievements.discard('builtin:punctuality')
        self.assertEqual(set(self.manager.achievements), achievements)
Exemplo n.º 5
0
class TestFilterAchievementManagerExclude(unittest.TestCase):
    def setUp(self):
        self.manager = FilterAchievementManager('-builtin:night-shift,'
                                                  '-builtin:punctuality',
                                                  BuiltinAchievementManager)
        self.manager.load()
        self.builtin_manager = BuiltinAchievementManager()
        self.builtin_manager.load()

    def test_achievements_are_excluded(self):
        achievements = set(self.builtin_manager.achievements)
        achievements.discard('builtin:night-shift')
        achievements.discard('builtin:punctuality')
        self.assertEqual(set(self.manager.achievements), achievements)
Exemplo n.º 6
0
 def setUp(self):
     self.manager = FilterAchievementManager('-builtin:night-shift,'
                                               '-builtin:punctuality',
                                               BuiltinAchievementManager)
     self.manager.load()
     self.builtin_manager = BuiltinAchievementManager()
     self.builtin_manager.load()
Exemplo n.º 7
0
 def setUp(self):
     self.manager = FilterAchievementManager('all',
                                             BuiltinAchievementManager)
     self.manager.load()
     self.builtin_manager = BuiltinAchievementManager()
     self.builtin_manager.load()
Exemplo n.º 8
0
 def setUp(self):
     self.manager = BuiltinAchievementManager()
     self.manager.load()
Exemplo n.º 9
0
 def setUp(self):
     self.manager = FilterAchievementManager('all', BuiltinAchievementManager)
     self.manager.load()
     self.builtin_manager = BuiltinAchievementManager()
     self.builtin_manager.load()
Exemplo n.º 10
0
 def setUp(self):
     self.manager = BuiltinAchievementManager()
     self.manager.load()