def test_metadata_action(self):
     with config.tempdir() as scratch:
         pkg_path = os.path.join(scratch, 'test.refpkg')
         r = refpkg.Refpkg(pkg_path, create=True)
         self.args.changes = ['meep=boris', 'hilda=vrrp']
         self.args.metadata = True
         self.args.refpkg = pkg_path
         update.action(self.args)
         r._sync_from_disk()
         self.assertEqual(r.metadata('meep'), 'boris')
         self.assertEqual(r.metadata('hilda'), 'vrrp')
Example #2
0
 def test_metadata_action(self):
     with config.tempdir() as scratch:
         pkg_path = os.path.join(scratch, 'test.refpkg')
         r = refpkg.Refpkg(pkg_path, create=True)
         self.args.changes = ['meep=boris', 'hilda=vrrp']
         self.args.metadata = True
         self.args.refpkg = pkg_path
         update.action(self.args)
         r._sync_from_disk()
         self.assertEqual(r.metadata('meep'), 'boris')
         self.assertEqual(r.metadata('hilda'), 'vrrp')
 def test_metadata_action(self):
     with config.tempdir() as scratch:
         pkg_path = os.path.join(scratch, 'test.refpkg')
         r = refpkg.Refpkg(pkg_path)
         class _Args(object):
             refpkg=pkg_path
             changes = ['meep=boris', 'hilda=vrrp']
             metadata = True
         update.action(_Args())
         r._sync_from_disk()
         self.assertEqual(r.metadata('meep'), 'boris')
         self.assertEqual(r.metadata('hilda'), 'vrrp')
 def test_action(self):
     with config.tempdir() as scratch:
         pkg_path = os.path.join(scratch, 'test.refpkg')
         r = refpkg.Refpkg(pkg_path)
         test_file = config.data_path('bv_refdata.csv')
         class _Args(object):
             refpkg=pkg_path
             changes = ['meep='+test_file, 'hilda='+test_file]
             metadata = False
         update.action(_Args())
         r._sync_from_disk()
         self.assertEqual(r.contents['files']['meep'], 'bv_refdata.csv')
         self.assertEqual(r.contents['files']['hilda'], 'bv_refdata.csv1')
    def test_update_stats_action(self):
        with config.tempdir() as scratch:
            pkg_path = os.path.join(scratch, 'test.refpkg')
            r = refpkg.Refpkg(pkg_path, create=True)

            args = self.args
            stats_path = os.path.join(config.datadir, 'phyml_aa_stats.txt')

            args.refpkg = pkg_path
            args.changes = ['tree_stats=' + stats_path]
            args.frequency_type = 'empirical'

            update.action(args)

            r._sync_from_disk()

            self.assertIn('tree_stats', r.contents['files'])
            self.assertIn('phylo_model', r.contents['files'])
            self.assertTrue(r.contents['files']['phylo_model'].endswith('.json'))
Example #6
0
    def test_update_stats_action(self):
        with config.tempdir() as scratch:
            pkg_path = os.path.join(scratch, 'test.refpkg')
            r = refpkg.Refpkg(pkg_path, create=True)

            args = self.args
            stats_path = os.path.join(config.datadir, 'phyml_aa_stats.txt')

            args.refpkg = pkg_path
            args.changes = ['tree_stats=' + stats_path]
            args.frequency_type = 'empirical'

            update.action(args)

            r._sync_from_disk()

            self.assertIn('tree_stats', r.contents['files'])
            self.assertIn('phylo_model', r.contents['files'])
            self.assertTrue(
                r.contents['files']['phylo_model'].endswith('.json'))
Example #7
0
    def test_action(self):
        with config.tempdir() as scratch:
            pkg_path = os.path.join(scratch, 'test.refpkg')
            r = refpkg.Refpkg(pkg_path, create=True)
            test_file = config.data_path('bv_refdata.csv')

            self.args.refpkg = pkg_path
            self.args.changes = ['meep=' + test_file, 'hilda=' + test_file]

            update.action(self.args)
            r._sync_from_disk()
            self.assertEqual(r.contents['files']['meep'], 'bv_refdata.csv')

            # Second file should have been assigned a non-clashing name
            h = r.contents['files']['hilda']
            self.assertNotEqual(h, 'bv_refdata.csv')
            self.assertTrue(h.startswith('bv_refdata'))
            self.assertTrue(h.endswith('.csv'))

            self.assertTrue(os.path.exists(r.resource_path('hilda')))
Example #8
0
    def test_action(self):
        with config.tempdir() as scratch:
            pkg_path = os.path.join(scratch, 'test.refpkg')
            r = refpkg.Refpkg(pkg_path, create=True)
            test_file = config.data_path('bv_refdata.csv')
            class _Args(object):
                refpkg=pkg_path
                changes = ['meep='+test_file, 'hilda='+test_file]
                metadata = False
            update.action(_Args())
            r._sync_from_disk()
            self.assertEqual(r.contents['files']['meep'], 'bv_refdata.csv')

            # Second file should have been assigned a non-clashing name
            h = r.contents['files']['hilda']
            self.assertNotEqual(h, 'bv_refdata.csv')
            self.assertTrue(h.startswith('bv_refdata'))
            self.assertTrue(h.endswith('.csv'))

            self.assertTrue(os.path.exists(r.resource_path('hilda')))