예제 #1
0
    def test_build_non_existant_remote_catalogue(self):
        conn = boto3.resource('s3', region_name='eu-west-1')
        conn.create_bucket(Bucket='www.example.com')

        project_root = os.path.join(MODULE_DIR, 'fixture_proj_1')
        p = Project(project_root)
        cat = p.get_remote_catalogue()
        self.assertEqual({}, cat.to_dict())
예제 #2
0
 def test_build_existing_old_csv_catalogue(self):
     conn = boto3.resource('s3', region_name='eu-west-1')
     conn.create_bucket(Bucket='www.example.com')
     b = conn.Bucket('www.example.com')
     exp_csv_p = os.path.join(MODULE_DIR, 'expected_cat_fixture_proj_1.csv')
     with open(exp_csv_p, 'rb') as exp_csv_f:
         b.put_object(Key='staging/.s3sup.catalogue.csv',
                      ACL='private',
                      Body=exp_csv_f)
     project_root = os.path.join(MODULE_DIR, 'fixture_proj_1')
     p = Project(project_root)
     cat = p.get_remote_catalogue()
     self.assertTrue('assets/logo.svg' in cat.to_dict())