Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
invisig0th committed Sep 17, 2024
1 parent 0305c0c commit 1972864
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
6 changes: 6 additions & 0 deletions synapse/tests/test_datamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ async def test_datamodel_basics(self):
with self.raises(s_exc.BadFormDef):
core.model.addForm('woot:two', {}, ())

with self.raises(s_exc.NoSuchForm):
core.model.reqForm('newp:newp')

with self.raises(s_exc.NoSuchProp):
core.model.reqForm('inet:asn').reqProp('newp')

async def test_datamodel_formname(self):
modl = s_datamodel.Model()
mods = (
Expand Down
15 changes: 15 additions & 0 deletions synapse/tests/test_lib_storm.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,21 @@ async def test_lib_storm_guidctor(self):
self.eq(goals, nodes08[0].get('goals'))
self.eq(nodes07[0].ndef, nodes08[0].ndef)

nodes09 = await core.nodes('[ ou:org=({"name": "vertex"}) :name=foobar :names=() ]')
nodes10 = await core.nodes('[ ou:org=({"name": "vertex"}) :type=lulz ]')
self.len(1, nodes09)
self.len(1, nodes10)
self.ne(nodes09[0].ndef, nodes10[0].ndef)

await core.nodes('[ ou:org=* :type=lulz ]')
await core.nodes('[ ou:org=* :type=hehe ]')
nodes11 = await core.nodes('[ ou:org=({"name": "vertex", "$props": {"type": "lulz"}}) ]')
self.len(1, nodes11)

nodes12 = await core.nodes('[ ou:org=({"name": "vertex", "type": "hehe"}) ]')
self.len(1, nodes12)
self.ne(nodes11[0].ndef, nodes12[0].ndef)

async def test_lib_storm_jsonexpr(self):
async with self.getTestCore() as core:

Expand Down
6 changes: 6 additions & 0 deletions synapse/tests/test_lib_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ def test_type(self):
self.none(t.getCompOffs('newp'))
self.raises(s_exc.NoSuchCmpr, t.cmpr, val1=1, name='newp', val2=0)

str00 = model.type('str').clone({})
str01 = model.type('str').clone({})
str02 = model.type('str').clone({'lower': True})
self.eq(str00, str01)
self.ne(str01, str02)

async def test_mass(self):

async with self.getTestCore() as core:
Expand Down

0 comments on commit 1972864

Please sign in to comment.