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