def test_bit_install_of_all_bits_in_project(self): install_service = mock.MagicMock() result = install_project_bits(install_service) assert result.status_code == OK install_service.install_all.assert_called_once()
def test_bit_install_of_all_bits_in_project_fails_when_one_bit_does_not_exist( self): install_service = mock.MagicMock() install_service.install_all.side_effect = BitNotFound result = install_project_bits(install_service) assert result.status_code == FAIL
def test_bit_install_of_all_bits_in_project_fails_when_http_connection_fails( self): install_service = mock.MagicMock() install_service.install_all.side_effect = HttpConnectionError result = install_project_bits(install_service) assert result.status_code == FAIL
def test_bit_install_of_all_bits_in_project_fails_when_current_directory_is_not_a_chromos_project( self): install_service = mock.MagicMock() install_service.install_all.side_effect = ProjectDescriptorNotFound result = install_project_bits(install_service) assert result.status_code == FAIL