Ejemplo n.º 1
0
 def test_init_with_invalid_adress(self):
     """Check that init returns an error when entering an invalid parameter"""
     with self.assertRaises(TypeError):
         dcc_switches.Switch("DCC1", "ad", 1)
Ejemplo n.º 2
0
 def test_biais_with_invalid_state_parameter(self):
     """Test that the fl function return an error when an invalid parameter is given"""
     with self.assertRaises(TypeError):
         dcc_switches.Switch("DCC3", 3, 2).biais = "j zxa"
Ejemplo n.º 3
0
 def test_biais_with_valid_parameter(self):
     """Test that the fl function work when a valid parameter is given"""
     dcc_switches.Switch("DCC3", 3, 2).biais = True
Ejemplo n.º 4
0
 def test_init_with_valid_adress_parameters(self):
     """ Test that the init function works when a correct adress name and biais_id are  given"""
     dcc_switches.Switch("DCC3", 3, 1)
Ejemplo n.º 5
0
 def test_init_with_invalid_biais_id(self):
     """Check that init returns an error when entering an invalid parameter"""
     with self.assertRaises(ValueError):
         dcc_switches.Switch("DCC3", "3", 5)
Ejemplo n.º 6
0
 def test_init_with_invalid_name(self):
     """Check that init returns an error when entering an invalid parameter"""
     with self.assertRaises(TypeError):
         dcc_switches.Switch(41, 5, 2)