Skip to content
Permalink
Browse files

hygiene: update and cleanup

  • Loading branch information
sysid committed Nov 27, 2019
1 parent adfafb9 commit 1fafcd706af68ddefe19aef3542561f677fe7f3b
@@ -1,3 +1,4 @@
example.db
############################## Python.gitignore ##############################
# Byte-compiled / optimized / DLL files
__pycache__/
@@ -1,5 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="PROJECT_PROFILE" value="Default" />
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
@@ -4,4 +4,7 @@
<option name="languageLevel" value="ES6" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (munggoggo-jlK1MmZJ)" project-jdk-type="Python SDK" />
<component name="PythonCompatibilityInspectionAdvertiser">
<option name="version" value="3" />
</component>
</project>
@@ -6,13 +6,20 @@ components:
type: string
type: object
info:
description: explanation of the api purpose
description: ASGI Agent
title: Example API
version: '1.0'
openapi: 3.0.0
paths:
/:
get: {}
get:
description: Home
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/PlatformInformation'
/jsonrpc:
post:
description: RPC
@@ -78,9 +78,9 @@ class TestBasics:
class TestSqlBehaviour:
async def test_connect_to_db(self, core1, json_data_values):
json_data_values = [
{"type": "type1", "ts": utcnow(), "data": '{"a": "aaa", "b": "bbb"}'},
{"type": "type1", "ts": utcnow(), "data": '{"a": "xxx", "b": "yyy"}'},
]
{"type": "type1", "ts": utcnow(), "data": '{"a": "aaa", "b": "bbb"}'},
{"type": "type1", "ts": utcnow(), "data": '{"a": "xxx", "b": "yyy"}'},
]

b = SqlBehav(core1)
await core1.add_runtime_dependency(b)
@@ -103,6 +103,7 @@ class TestSqlBehaviour:
message="xxxx",
date=datetime(2019, 1, 1, tzinfo=pytz.UTC)
).serialize()

# when messages are published
await sql_behav.publish(msg, "x.y")
await asyncio.sleep(0.1) # relinquish cpu
@@ -117,6 +118,7 @@ class TestSqlBehaviour:

# Given SerializableObject message
msg = "xxx"

# when messages are published
await sql_behav.publish(msg, "x.y")
await asyncio.sleep(0.1) # relinquish cpu
@@ -147,7 +149,6 @@ class TestSqlBehaviour:
rows = await sql_behav.db.fetch_all(query=query)
assert len(rows) == n


async def test_receive_topic_and_store_serializable_obj(self, sql_behav):
# Given SerializableObject message
@dataclass_json
@@ -172,4 +173,3 @@ class MyData(SerializableObject):
query = json_data.select()
rows = await sql_behav.db.fetch_all(query=query)
assert len(rows) == 1

0 comments on commit 1fafcd7

Please sign in to comment.
You can’t perform that action at this time.