コード例 #1
0
ファイル: database_test.py プロジェクト: vishalbelsare/orion
    def test_read(self, create_db_instance):
        """Test read is coherent from view and wrapped database."""
        database = create_db_instance
        readonly_database = ReadOnlyDB(database)

        args = {"collection_name": "trials", "query": {"experiment": "supernaedo2"}}
        readonly_result = readonly_database.read(**args)
        result = database.read(**args)

        assert len(result) > 0  # Otherwise the test is pointless
        assert readonly_result == result
コード例 #2
0
ファイル: database_test.py プロジェクト: lebrice/orion
    def test_read(self, hacked_exp):
        """Test read is coherent from view and wrapped database."""
        database = get_storage()._db
        readonly_database = ReadOnlyDB(database)

        args = {
            "collection_name": "experiments",
            "query": {
                "name": "supernaedo2-dendi"
            },
        }
        readonly_result = readonly_database.read(**args)
        result = database.read(**args)

        assert len(result) > 0  # Otherwise the test is pointless
        assert readonly_result == result