Esempio n. 1
0
    def test_queue_noIds(self):
        """Does the queue function work as expected.

        This version tests when node.locationId's are
        Null
        """

        #So for houseId 2 we should have
        # Location, Room,         Node
        # 3         Master Bed ,  1061
        # 4         Bathroom   ,  1063

        out = yields.queuenodes(2)
        #Is split into two tuples
        nids, desc = out

        #Are the node Ids as expected
        self.assertEqual(nids, [1061, 1063])

        #Are the dscriptions as expected
        thedesc = [{"nodeid":1061,
                    "locationid":3,
                    "room": "Master Bedroom",
                    },
                   {"nodeid":1063,
                    "locationid":4,
                    "room": "Bathroom",
                    }
                   ]

        self.assertEqual(desc, thedesc)
Esempio n. 2
0
    def test_queue(self):
        """Does the queue function work as expected.

        This version tests when node.locationId's are available
        """

        #So for houseId 1 we should have
        # Location, Room,         Node
        # 1         Master Bed ,  837
        # 2         Bathroom   ,  838

        out = yields.queuenodes(1)
        #Is split into two tuples
        nids, desc = out

        #Are the node Ids as expected
        self.assertEqual(nids, [837, 838])

        #Are the dscriptions as expected
        thedesc = [{"nodeid":837,
                    "locationid":1,
                    "room": "Master Bedroom",
                    },
                   {"nodeid":838,
                    "locationid":2,
                    "room": "Bathroom",
                    }
                   ]

        self.assertEqual(desc, thedesc)