コード例 #1
0
    def setUp(self):
        # Clean all tables
        import os
        self.pill = StreamPill(debug=False)
        self.session = boto3.session.Session()
        boto3.DEFAULT_SESSION = self.session
        self.pill.attach(
            self.session,
            os.path.abspath(os.path.join(os.path.dirname(__file__), 'pill')))
        self.pill.playback()

        for table in reversed(self.db.metadata.sorted_tables):
            self.db.session.execute(table.delete())
        self.db.session.commit()
        self.db.session.expunge_all()

        # Loading fixtures
        from api.accounts.fixtures import UserData
        if UserData not in self.datasets:
            self.datasets = list(self.datasets)
            self.datasets.append(UserData)

        try:
            self.load_fixtures(*self.datasets)
        except Exception, exc:
            logging.warning('Problem with loading fixture %s: %s',
                            self.datasets, exc)
コード例 #2
0
 def setUp(self):
     super(AmazonEC2HelperTests, self).setUp()
     self.pill = StreamPill(debug=False)
     self.session = boto3.session.Session()
     boto3.DEFAULT_SESSION = self.session
     self.credentials = {
         'token': 'token',
         'secret': 'secret',
         'region': 'region'
     }
コード例 #3
0
ファイル: datasource_tests.py プロジェクト: pybender/cloudml
 def setUp(self):
     super(PigDataSourceTests, self).setUp()
     self.pill = StreamPill(debug=True)
     self.session = boto3.session.Session()
     boto3.DEFAULT_SESSION = self.session
コード例 #4
0
 def setUp(self):
     super(AmazonDynamoDBHelperTests, self).setUp()
     self.pill = StreamPill(debug=False)
     self.session = boto3.session.Session()
     boto3.DEFAULT_SESSION = self.session
コード例 #5
0
 def setUp(self):
     super(PigXMLPlanTest, self).setUp()
     self.pill = StreamPill(debug=True)
     self.session = boto3.session.Session()
     boto3.DEFAULT_SESSION = self.session