예제 #1
0
    def test_get_ipmi_none(self):

        serializer = EquipmentSerializer()
        ipmi = {
            'IPMI Hostname': None,
            'IPMI Mac': None
        }
        self.assertEqual(ipmi, serializer.get_ipmi(None))
예제 #2
0
    def test_get_ipmi_nonexistent(self):

        equipment = Equipment.objects.get(serial='R123457')
        serializer = EquipmentSerializer()
        ipmi = {
            'IPMI Hostname': None,
            'IPMI Mac': None
        }
        self.assertEqual(ipmi, serializer.get_ipmi(equipment))
예제 #3
0
    def test_get_ipmi_existent(self):

        equipment = Equipment.objects.get(serial='G123456')
        serializer = EquipmentSerializer()
        ipmi = {
            'IPMI Hostname': equipment.servermanagement.hostname,
            'IPMI Mac': equipment.servermanagement.mac
        }
        self.assertEqual(ipmi, serializer.get_ipmi(equipment))