コード例 #1
0
ファイル: database.py プロジェクト: Meng-Gen/YuantaCat
class Database():
    def __init__(self):
        self.impl = PostgresDatabase("dbname='stockcat' user='******' host='localhost' password='******'")

    def store(self, feed):
        return self.impl.store(feed)

    def get(self, operation, param):
        return self.impl.get(operation, param)
コード例 #2
0
class Database():
    def __init__(self):
        self.impl = PostgresDatabase(
            "dbname='stockcat' user='******' host='localhost' password='******'"
        )

    def store(self, feed):
        return self.impl.store(feed)

    def get(self, operation, param):
        return self.impl.get(operation, param)
コード例 #3
0
class PostgresDatabaseTest(unittest.TestCase):
    def setUp(self):
        self.database = PostgresDatabase("dbname='stockcat' user='******' host='localhost' password='******'")

    def tearDown(self):
        self.database = None
    
    def test_get_stock_symbol_list(self):
        stock_symbol_list = self.database.get_stock_symbol_list()
        self.assertEqual(stock_symbol_list[0], ('1101', datetime.date(1962, 2, 9)))
        self.assertEqual(stock_symbol_list[1], ('1102', datetime.date(1962, 6, 8)))
コード例 #4
0
 def __init__(self):
     self.impl = PostgresDatabase(
         "dbname='stockcat' user='******' host='localhost' password='******'"
     )
コード例 #5
0
 def setUp(self):
     self.database = PostgresDatabase("dbname='stockcat' user='******' host='localhost' password='******'")
コード例 #6
0
ファイル: database.py プロジェクト: Meng-Gen/YuantaCat
 def __init__(self):
     self.impl = PostgresDatabase("dbname='stockcat' user='******' host='localhost' password='******'")