Esempio n. 1
0
 def _defaultHuts(self):
     return [SimpleHut(3, 3, 4),
             SimpleHut(3, 3, 5),
             SimpleHut(3, 3, 6),
             SimpleHut(3, 4, 5),
             SimpleHut(3, 4, 4),
             SimpleHut(3, 5, 5),
             SimpleHut(3, 4, 6),
             SimpleHut(3, 4, 6),
             SimpleHut(3, 4, 5),
             SimpleHut(3, 5, 6),
             SimpleHut(3, 5, 6),
             SimpleHut(4, 4, 5),
             SimpleHut(4, 4, 6),
             SimpleHut(4, 5, 5),
             SimpleHut(4, 5, 6),
             SimpleHut(4, 5, 6),
             SimpleHut(5, 5, 6),
             AnyHut(),
             AnyHut(),
             AnyHut(),
             CountHut(4,1),
             CountHut(4,2),
             CountHut(4,3),
             CountHut(4,4),
             CountHut(5,1),
             CountHut(5,2),
             CountHut(5,3),
             CountHut(5,4),
             ]
Esempio n. 2
0
    def testAnyHutWithMoreThanSevenResources(self):
        hut = AnyHut()
        resources = [3, 3, 3, 5, 5, 5, 5, 5]

        self.assertEqual([], hut.missing(resources))
        self.assertEqual(0, hut.value(),
                         "value should be 0 before cost is calculated")

        self.assertEqual([3, 3, 3, 5, 5, 5, 5], hut.costs(resources))
        self.assertEqual(29, hut.value(), "value should be 29")
Esempio n. 3
0
    def testAnyHutWithOnlyFood(self):
        hut = AnyHut()
        resources = [2, 2]

        self.assertEqual([3], hut.missing(resources))
        self.assertEqual([], hut.costs(resources))
Esempio n. 4
0
    def testAnyHutWithResources(self):
        hut = AnyHut()
        resources = [2, 2, 3, 5, 5]

        self.assertEqual([], hut.missing(resources))
        self.assertEqual([3, 5, 5], hut.costs(resources))
Esempio n. 5
0
    def testAnyHutWithNoResources(self):
        hut = AnyHut()
        resources = []

        self.assertEqual([3], hut.missing(resources))