Exemplo 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)
Exemplo 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)
Exemplo 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
Exemplo 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 == []
Exemplo 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
Exemplo 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 == []
Exemplo 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
Exemplo 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
Exemplo 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)
Exemplo 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
Exemplo 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
Exemplo 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)