def test_single_source(self, mock_check_output): """Assert single source downloads output are parsed neatly""" mock_check_output.return_value = """ Downloading requests-2.13.0.tar.gz ####################################################################### 100.0% """ sources = buildsys.dist_git_sources("/my/repo") mock_check_output.assert_called_once_with(["fedpkg", "sources"], cwd="/my/repo") self.assertEqual(["/my/repo/requests-2.13.0.tar.gz"], sources)
def test_single_source(self, mock_check_output): """Assert single source downloads output are parsed neatly""" mock_check_output.return_value = """ Downloading requests-2.13.0.tar.gz ####################################################################### 100.0% """ sources = buildsys.dist_git_sources('/my/repo') mock_check_output.assert_called_once_with(['fedpkg', 'sources'], cwd='/my/repo') self.assertEqual(['/my/repo/requests-2.13.0.tar.gz'], sources)
def test_single_source(self, mock_check_output): """Assert single source downloads output are parsed neatly""" mock_check_output.return_value = b""" Downloading requests-2.13.0.tar.gz ####################################################################### 100.0% """ sources = buildsys.dist_git_sources("/my/repo") mock_check_output.assert_called_once_with( ["fedpkg", "--user", "hotness", "sources"], cwd="/my/repo") self.assertEqual(["/my/repo/requests-2.13.0.tar.gz"], sources)
def test_multiple_sources(self, mock_check_output): """Assert multiple source downloads output are parsed neatly""" mock_check_output.return_value = """ Downloading requests-2.12.4.tar.gz ####################################################################### 100.0% Downloading requests-2.12.4-tests.tar.gz ####################################################################### 100.0% """ sources = buildsys.dist_git_sources("/my/repo") mock_check_output.assert_called_once_with(["fedpkg", "sources"], cwd="/my/repo") self.assertEqual( [ "/my/repo/requests-2.12.4.tar.gz", "/my/repo/requests-2.12.4-tests.tar.gz", ], sources, )