Beispiel #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'
Beispiel #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'
Beispiel #3
0
 def test_string_is_right_and_matches_node_from_label(self):
     msg = BecauseNodeIsBusy % 'amd64'
     assert util.from_label(msg) == 'wheezy'
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #7
0
 def test_string_is_garbage(self):
     assert util.from_label('') is None
Beispiel #8
0
 def test_string_is_right_and_matches_node_from_label(self):
     msg = BecauseNodeIsBusy % 'amd64'
     assert util.from_label(msg) == 'wheezy'
Beispiel #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'
Beispiel #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
Beispiel #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'
Beispiel #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
Beispiel #13
0
 def test_string_is_garbage(self):
     assert util.from_label('') is None
Beispiel #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"
Beispiel #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
Beispiel #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
Beispiel #17
0
 def test_label_is_busy_unicode(self):
     msg = BecauseLabelIsBusy % 'huge&&amd64'
     assert util.from_label(msg) == 'wheezy'
Beispiel #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