Ejemplo n.º 1
0
 def test_matches_node_with_plus_sign_from_name(self):
     msg = BecauseNodeIsBusy % 'wheezy__192.168.1.12'
     assert util.from_label(msg) == 'wheezy'
Ejemplo n.º 2
0
 def test_string_is_right_and_matches_node_from_name(self):
     msg = BecauseNodeIsBusy % 'wheezy'
     self.default_conf['nodes']['wheezy']['labels'] = []
     set_config(self.default_conf, overwrite=True)
     assert util.from_label(msg) == 'wheezy'
Ejemplo n.º 3
0
 def test_string_is_right_and_matches_node_from_label(self):
     msg = BecauseNodeIsBusy % 'amd64'
     assert util.from_label(msg) == 'wheezy'
Ejemplo n.º 4
0
 def test_string_is_wrong_does_not_match(self):
     self.default_conf['nodes'] = {}
     set_config(self.default_conf, overwrite=True)
     assert util.from_label('this is not garbage') is None
Ejemplo n.º 5
0
 def test_string_is_right_but_does_not_match(self):
     msg = BecauseNodeIsBusy % 'wheezy'
     self.default_conf['nodes'] = {}
     set_config(self.default_conf, overwrite=True)
     assert util.from_label(msg) is None
Ejemplo n.º 6
0
 def test_string_is_right_but_does_not_match(self):
     msg = BecauseNodeIsBusy % "wheezy"
     set_config({"nodes": {}}, overwrite=True)
     assert util.from_label(msg) is None
Ejemplo n.º 7
0
 def test_string_is_garbage(self):
     assert util.from_label('') is None
Ejemplo n.º 8
0
 def test_string_is_right_and_matches_node_from_label(self):
     msg = BecauseNodeIsBusy % 'amd64'
     assert util.from_label(msg) == 'wheezy'
Ejemplo n.º 9
0
 def test_matches_node_with_plus_sign_from_name(self):
     msg = BecauseNodeIsBusy % 'wheezy__192.168.1.12'
     assert util.from_label(msg) == 'wheezy'
Ejemplo n.º 10
0
 def test_string_is_right_but_does_not_match(self):
     msg = BecauseNodeIsBusy % 'wheezy'
     self.default_conf['nodes'] = {}
     set_config(self.default_conf, overwrite=True)
     assert util.from_label(msg) is None
Ejemplo n.º 11
0
 def test_string_is_right_and_matches_node_from_name(self):
     msg = BecauseNodeIsBusy % 'wheezy'
     self.default_conf['nodes']['wheezy']['labels'] = []
     set_config(self.default_conf, overwrite=True)
     assert util.from_label(msg) == 'wheezy'
Ejemplo n.º 12
0
 def test_string_is_wrong_does_not_match(self):
     self.default_conf['nodes'] = {}
     set_config(self.default_conf, overwrite=True)
     assert util.from_label('this is not garbage') is None
Ejemplo n.º 13
0
 def test_string_is_garbage(self):
     assert util.from_label('') is None
Ejemplo n.º 14
0
 def test_string_is_right_and_matches_node_from_name(self):
     msg = BecauseNodeIsBusy % "wheezy"
     set_config({"nodes": {"wheezy": {"labels": []}}})
     assert util.from_label(msg) == "wheezy"
Ejemplo n.º 15
0
 def test_no_match_with_plus_sign_from_name(self):
     msg = BecauseNodeIsBusy % 'centos6__192.168.1.12'
     assert util.from_label(msg) is None
Ejemplo n.º 16
0
 def test_no_match_with_plus_sign_from_name(self):
     msg = BecauseNodeIsBusy % 'centos6__192.168.1.12'
     assert util.from_label(msg) is None
Ejemplo n.º 17
0
 def test_label_is_busy_unicode(self):
     msg = BecauseLabelIsBusy % 'huge&&amd64'
     assert util.from_label(msg) == 'wheezy'
Ejemplo n.º 18
0
 def test_string_is_wrong_does_not_match(self):
     set_config({"nodes": {}}, overwrite=True)
     assert util.from_label("this is not garbage") is None