Esempio n. 1
0
 def test_add(self):
     bl1 = BuildsList.from_dict_list(self.data)
     bl2 = BuildsList.from_dict_list(self.more_data)
     exp_data = self.data + self.more_data
     exp_bl = BuildsList.from_dict_list(exp_data)
     out_bl = bl1 + bl2
     assert id(out_bl) != id(exp_bl)
     assert out_bl == exp_bl
     assert len(out_bl) == len(self.data) + len(self.more_data)
     assert isinstance(out_bl, BuildsList)
Esempio n. 2
0
 def test_add(self):
     bl1 = BuildsList.from_dict_list(self.data)
     bl2 = BuildsList.from_dict_list(self.more_data)
     exp_data = self.data + self.more_data
     exp_bl = BuildsList.from_dict_list(exp_data)
     out_bl = bl1 + bl2
     assert id(out_bl) != id(exp_bl)
     assert out_bl == exp_bl
     assert len(out_bl) == len(self.data) + len(self.more_data)
     assert isinstance(out_bl, BuildsList)
Esempio n. 3
0
 def test_as_repoman_conf(self, monkeypatch):
     monkeypatch.setenv('JENKINS_URL', 'http://jenkins.example.org')
     exp = dedent("""
         http://jenkins.example.org/u3/5
         http://jenkins.example.org/u4/3
     """).lstrip()
     bl = BuildsList.from_dict_list(self.more_data)
     out = bl.as_repoman_conf()
     assert exp == out
Esempio n. 4
0
 def test_from_env_json(self, monkeypatch):
     exp = BuildsList.from_dict_list(self.data)
     monkeypatch.setenv('BUILDS_LIST', self.data_str)
     bl = BuildsList.from_env_json()
     assert id(exp) != id(bl)
     assert exp == bl
     monkeypatch.delenv('BUILDS_LIST', raising=False)
     bl = BuildsList.from_env_json()
     assert bl == []
Esempio n. 5
0
 def test_as_repoman_conf(self, monkeypatch):
     monkeypatch.setenv('JENKINS_URL', 'http://jenkins.example.org')
     exp = dedent("""
         http://jenkins.example.org/u3/5
         http://jenkins.example.org/u4/3
     """).lstrip()
     bl = BuildsList.from_dict_list(self.more_data)
     out = bl.as_repoman_conf()
     assert exp == out
Esempio n. 6
0
 def test_from_env_json(self, monkeypatch):
     exp = BuildsList.from_dict_list(self.data)
     monkeypatch.setenv('BUILDS_LIST', self.data_str)
     bl = BuildsList.from_env_json()
     assert id(exp) != id(bl)
     assert exp == bl
     monkeypatch.delenv('BUILDS_LIST', raising=False)
     bl = BuildsList.from_env_json()
     assert bl == []
Esempio n. 7
0
 def test_as_dict_list(self):
     bl = BuildsList.from_dict_list(self.data)
     out = bl.as_dict_list()
     assert self.data == out
Esempio n. 8
0
 def test_from_json_str(self):
     exp = BuildsList.from_dict_list(self.data)
     bl = BuildsList.from_json_str(self.data_str)
     assert id(exp) != id(bl)
     assert exp == bl
Esempio n. 9
0
 def test_from_dict_list(self):
     bl = BuildsList.from_dict_list(self.data)
     assert len(self.data) == len(bl)
     assert next((False for b in bl if not isinstance(b, BuildPtr)), True)
Esempio n. 10
0
 def test_as_dict_list(self):
     bl = BuildsList.from_dict_list(self.data)
     out = bl.as_dict_list()
     assert self.data == out
Esempio n. 11
0
 def test_from_json_str(self):
     exp = BuildsList.from_dict_list(self.data)
     bl = BuildsList.from_json_str(self.data_str)
     assert id(exp) != id(bl)
     assert exp == bl
Esempio n. 12
0
 def test_from_dict_list(self):
     bl = BuildsList.from_dict_list(self.data)
     assert len(self.data) == len(bl)
     assert next((False for b in bl if not isinstance(b, BuildPtr)), True)