def test_load_repo_data(self): repo_data = { 'tool_shed_status': { 'latest_installable_revision': 'True', 'revision_update': 'False', 'revision_upgrade': 'False', 'repository_deprecated': 'False' }, 'status': 'Installed', 'name': 'trimmomatic', 'deleted': False, 'ctx_rev': '2', 'error_message': '', 'installed_changeset_revision': 'a60283899c6d', 'tool_shed': 'toolshed.g2.bx.psu.edu', 'dist_to_shed': False, 'url': '/galaxy_dev/api/tool_shed_repositories/68b273cb7d2d6cff', 'id': '68b273cb7d2d6cff', 'owner': 'pjbriggs', 'uninstalled': False, 'changeset_revision': 'a60283899c6d', 'includes_datatypes': False } repo = Repository(repo_data) self.assertEqual(repo.name,'trimmomatic') self.assertEqual(repo.owner,'pjbriggs') self.assertEqual(repo.tool_shed,'toolshed.g2.bx.psu.edu') self.assertEqual(repo.id, 'toolshed.g2.bx.psu.edu/pjbriggs/trimmomatic') revisions = repo.revisions() self.assertEqual(len(revisions),1) self.assertEqual(revisions[0].revision_number,'2') self.assertEqual(revisions[0].changeset_revision,'a60283899c6d') self.assertEqual(revisions[0].installed_changeset_revision, 'a60283899c6d') self.assertEqual(revisions[0].status,'Installed') self.assertEqual(revisions[0].error_message,'') self.assertFalse(revisions[0].deleted) self.assertFalse(revisions[0].revision_update) self.assertFalse(revisions[0].revision_upgrade) self.assertTrue(revisions[0].latest_revision) self.assertEqual(revisions[0].revision_id,'2:a60283899c6d')
def test_load_repo_data(self): repo_data = { u'tool_shed_status': { u'latest_installable_revision': u'True', u'revision_update': u'False', u'revision_upgrade': u'False', u'repository_deprecated': u'False' }, u'status': u'Installed', u'name': u'trimmomatic', u'deleted': False, u'ctx_rev': u'2', u'error_message': u'', u'installed_changeset_revision': u'a60283899c6d', u'tool_shed': u'toolshed.g2.bx.psu.edu', u'dist_to_shed': False, u'url': u'/galaxy_dev/api/tool_shed_repositories/68b273cb7d2d6cff', u'id': u'68b273cb7d2d6cff', u'owner': u'pjbriggs', u'uninstalled': False, u'changeset_revision': u'a60283899c6d', u'includes_datatypes': False } repo = Repository(repo_data) self.assertEqual(repo.name,'trimmomatic') self.assertEqual(repo.owner,'pjbriggs') self.assertEqual(repo.tool_shed,'toolshed.g2.bx.psu.edu') self.assertEqual(repo.id, 'toolshed.g2.bx.psu.edu/pjbriggs/trimmomatic') revisions = repo.revisions() self.assertEqual(len(revisions),1) self.assertEqual(revisions[0].revision_number,'2') self.assertEqual(revisions[0].changeset_revision,'a60283899c6d') self.assertEqual(revisions[0].installed_changeset_revision, 'a60283899c6d') self.assertEqual(revisions[0].status,'Installed') self.assertEqual(revisions[0].error_message,'') self.assertFalse(revisions[0].deleted) self.assertFalse(revisions[0].revision_update) self.assertFalse(revisions[0].revision_upgrade) self.assertTrue(revisions[0].latest_revision) self.assertEqual(revisions[0].revision_id,'2:a60283899c6d')
def test_multiple_revisions(self): repo_data1 = { 'tool_shed_status': { 'latest_installable_revision': 'True', 'revision_update': 'False', 'revision_upgrade': 'False', 'repository_deprecated': 'False' }, 'status': 'Installed', 'name': 'trimmomatic', 'deleted': False, 'ctx_rev': '2', 'error_message': '', 'installed_changeset_revision': 'a60283899c6d', 'tool_shed': 'toolshed.g2.bx.psu.edu', 'dist_to_shed': False, 'url': '/galaxy_dev/api/tool_shed_repositories/68b273cb7d2d6cff', 'id': '68b273cb7d2d6cff', 'owner': 'pjbriggs', 'uninstalled': False, 'changeset_revision': 'a60283899c6d', 'includes_datatypes': False } repo_data2 = { 'tool_shed_status': {'latest_installable_revision': 'False', 'revision_update': 'False', 'revision_upgrade': 'True', 'repository_deprecated': 'False' }, 'status': 'Installed', 'name': 'trimmomatic', 'deleted': False, 'ctx_rev': '1', 'error_message': '', 'installed_changeset_revision': '3358c3d30143', 'tool_shed': 'toolshed.g2.bx.psu.edu', 'dist_to_shed': False, 'url': '/galaxy_dev/api/tool_shed_repositories/d6f760c242aa425c', 'id': 'd6f760c242aa425c', 'owner': 'pjbriggs', 'uninstalled': False, 'changeset_revision': '2bd7cdbb6228', 'includes_datatypes': False} repo = Repository(repo_data2) repo.add_revision(repo_data1) self.assertEqual(repo.name,'trimmomatic') self.assertEqual(repo.owner,'pjbriggs') self.assertEqual(repo.tool_shed,'toolshed.g2.bx.psu.edu') self.assertEqual(repo.id, 'toolshed.g2.bx.psu.edu/pjbriggs/trimmomatic') revisions = repo.revisions() # Most recent revision self.assertEqual(len(revisions),2) self.assertEqual(revisions[0].revision_number,'2') self.assertEqual(revisions[0].changeset_revision,'a60283899c6d') self.assertEqual(revisions[0].installed_changeset_revision, 'a60283899c6d') self.assertEqual(revisions[0].status,'Installed') self.assertEqual(revisions[0].error_message,'') self.assertFalse(revisions[0].deleted) self.assertFalse(revisions[0].revision_update) self.assertFalse(revisions[0].revision_upgrade) self.assertTrue(revisions[0].latest_revision) self.assertEqual(revisions[0].revision_id,'2:a60283899c6d') # Previous revision self.assertEqual(revisions[1].revision_number,'1') self.assertEqual(revisions[1].changeset_revision,'2bd7cdbb6228') self.assertEqual(revisions[1].installed_changeset_revision, '3358c3d30143') self.assertEqual(revisions[1].status,'Installed') self.assertEqual(revisions[1].error_message,'') self.assertFalse(revisions[1].deleted) self.assertFalse(revisions[1].revision_update) self.assertTrue(revisions[1].revision_upgrade) self.assertFalse(revisions[1].latest_revision) self.assertEqual(revisions[1].revision_id,'1:2bd7cdbb6228')
def test_multiple_revisions(self): repo_data1 = { u'tool_shed_status': { u'latest_installable_revision': u'True', u'revision_update': u'False', u'revision_upgrade': u'False', u'repository_deprecated': u'False' }, u'status': u'Installed', u'name': u'trimmomatic', u'deleted': False, u'ctx_rev': u'2', u'error_message': u'', u'installed_changeset_revision': u'a60283899c6d', u'tool_shed': u'toolshed.g2.bx.psu.edu', u'dist_to_shed': False, u'url': u'/galaxy_dev/api/tool_shed_repositories/68b273cb7d2d6cff', u'id': u'68b273cb7d2d6cff', u'owner': u'pjbriggs', u'uninstalled': False, u'changeset_revision': u'a60283899c6d', u'includes_datatypes': False } repo_data2 = { u'tool_shed_status': {u'latest_installable_revision': u'False', u'revision_update': u'False', u'revision_upgrade': u'True', u'repository_deprecated': u'False' }, u'status': u'Installed', u'name': u'trimmomatic', u'deleted': False, u'ctx_rev': u'1', u'error_message': u'', u'installed_changeset_revision': u'3358c3d30143', u'tool_shed': u'toolshed.g2.bx.psu.edu', u'dist_to_shed': False, u'url': u'/galaxy_dev/api/tool_shed_repositories/d6f760c242aa425c', u'id': u'd6f760c242aa425c', u'owner': u'pjbriggs', u'uninstalled': False, u'changeset_revision': u'2bd7cdbb6228', u'includes_datatypes': False} repo = Repository(repo_data2) repo.add_revision(repo_data1) self.assertEqual(repo.name,'trimmomatic') self.assertEqual(repo.owner,'pjbriggs') self.assertEqual(repo.tool_shed,'toolshed.g2.bx.psu.edu') self.assertEqual(repo.id, 'toolshed.g2.bx.psu.edu/pjbriggs/trimmomatic') revisions = repo.revisions() # Most recent revision self.assertEqual(len(revisions),2) self.assertEqual(revisions[0].revision_number,'2') self.assertEqual(revisions[0].changeset_revision,'a60283899c6d') self.assertEqual(revisions[0].installed_changeset_revision, 'a60283899c6d') self.assertEqual(revisions[0].status,'Installed') self.assertEqual(revisions[0].error_message,'') self.assertFalse(revisions[0].deleted) self.assertFalse(revisions[0].revision_update) self.assertFalse(revisions[0].revision_upgrade) self.assertTrue(revisions[0].latest_revision) self.assertEqual(revisions[0].revision_id,'2:a60283899c6d') # Previous revision self.assertEqual(revisions[1].revision_number,'1') self.assertEqual(revisions[1].changeset_revision,'2bd7cdbb6228') self.assertEqual(revisions[1].installed_changeset_revision, '3358c3d30143') self.assertEqual(revisions[1].status,'Installed') self.assertEqual(revisions[1].error_message,'') self.assertFalse(revisions[1].deleted) self.assertFalse(revisions[1].revision_update) self.assertTrue(revisions[1].revision_upgrade) self.assertFalse(revisions[1].latest_revision) self.assertEqual(revisions[1].revision_id,'1:2bd7cdbb6228')