class SourceTest(unittest.TestCase): """source test subclass""" def setUp(self): self.ssh_source = Source(GITHUB_SSH_SOURCE_YAML) self.https_source = Source(GITHUB_HTTPS_SOURCE_YAML) def test_get_yaml(self): """Test get_yaml() method""" self.assertEqual(self.ssh_source.get_yaml(), GITHUB_SSH_SOURCE_YAML) self.assertEqual(self.https_source.get_yaml(), GITHUB_HTTPS_SOURCE_YAML) def test_https_url_prefix(self): """Test https url prefix""" self.assertEqual(self.https_source.get_url_prefix(), 'https://github.com/') def test_member_variables(self): """Test the state of all project member variables initialized""" self.assertEqual(self.ssh_source.name, 'github-ssh') self.assertEqual(self.ssh_source.url, 'ssh://[email protected]') self.assertEqual(self.https_source.name, 'github') self.assertEqual(self.https_source.url, 'https://github.com') def test_ssh_url_prefix(self): """Test ssh url prefix""" self.assertEqual(self.ssh_source.get_url_prefix(), '[email protected]:')
def setUp(self): self.name = 'test_fork' self.remote = 'origin' self.fork_yaml = {'name': self.name, 'remote': self.remote} self.source = Source(GITHUB_SSH_SOURCE_YAML) self.path = '/fork/path' self.fork = Fork(self.fork_yaml, self.path, self.source)
class ForkTest(unittest.TestCase): """fork test subclass""" def setUp(self): self.name = 'test_fork' self.remote = 'origin' self.fork_yaml = {'name': self.name, 'remote': self.remote} self.source = Source(GITHUB_SSH_SOURCE_YAML) self.path = '/fork/path' self.fork = Fork(self.fork_yaml, self.path, self.source) def test_get_yaml(self): """Test get_yaml() method""" self.assertEqual(self.fork.get_yaml(), self.fork_yaml) def test_member_variables(self): """Test the state of all project member variables initialized""" self.assertEqual(self.fork.path, self.path) self.assertEqual(self.fork.name, self.name) self.assertEqual(self.fork.remote, self.remote) self.assertEqual(self.fork.url, self.source.get_url_prefix() + self.name + ".git")
def setUp(self): self.ssh_source = Source(GITHUB_SSH_SOURCE_YAML) self.https_source = Source(GITHUB_HTTPS_SOURCE_YAML)