def test_check_project_check_times(self, mock_method): """ Test if check times are set. """ project = utilities.create_project( self.session, name='pypi_and_npm', homepage='https://example.com/not-a-real-npmjs-project', backend='npmjs', user_id='*****@*****.**') last_check_orig = project.last_check utilities.check_project_release(project, self.session) next_check = plugins.get_plugin( project.backend).check_interval + project.last_check self.assertTrue(last_check_orig < project.last_check) self.assertEqual(next_check, project.next_check)
def test_check_project_check_times(self, mock_method): """ Test if check times are set. """ project = utilities.create_project( self.session, name="pypi_and_npm", homepage="https://example.com/not-a-real-npmjs-project", backend="npmjs", user_id="*****@*****.**", ) last_check_orig = project.last_check utilities.check_project_release(project, self.session) next_check = ( plugins.get_plugin(project.backend).check_interval + project.last_check ) self.assertTrue(last_check_orig < project.last_check) self.assertEqual(next_check, project.next_check)
def test_check_project_check_times(self, mock_method): """ Test if check times are set. """ with fml_testing.mock_sends(anitya_schema.ProjectCreated): project = utilities.create_project( self.session, name="pypi_and_npm", homepage="https://example.com/not-a-real-npmjs-project", backend="npmjs", user_id="*****@*****.**", ) last_check_orig = project.last_check with fml_testing.mock_sends(anitya_schema.ProjectVersionUpdated): utilities.check_project_release(project, self.session) next_check = (plugins.get_plugin(project.backend).check_interval + project.last_check) self.assertTrue(last_check_orig < project.last_check) self.assertEqual(next_check, project.next_check)
def test_plugins_get_plugin(self): """ Test the plugins.get_plugin function. """ plugin = plugins.get_plugin('PyPI') self.assertEqual(str(plugin), "<class 'anitya.lib.backends.pypi.PypiBackend'>")
def test_plugins_get_plugin(self): """ Test the plugins.get_plugin function. """ plugin = plugins.get_plugin('PyPI') self.assertEqual( str(plugin), "<class 'anitya.lib.backends.pypi.PypiBackend'>")