Skip to content

Commit

Permalink
Add tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
dnwpark committed May 24, 2024
1 parent 1863148 commit adf356a
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions tests/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -1641,6 +1641,21 @@ def test_schema_rewrite_order_01(self):
}
"""

def test_schema_rewrite_order_02(self):
# One of the properties is going to reference the other property
# before it is created in its rewrite via __specified__.
# Ensure that this gets ordered correctly.
"""
type User {
property foo -> bool {
rewrite insert using (__specified__.bar);
};
property bar -> bool {
rewrite insert using (__specified__.foo);
};
};
"""

def test_schema_scalar_order_01(self):
# Make sure scalar types account for base types when tracing SDL
# dependencies.
Expand Down Expand Up @@ -9111,6 +9126,44 @@ def test_schema_migrations_rewrites_01(self):
""",
])

def test_schema_migrations_rewrites_02(self):
self._assert_migration_equivalence([
r"""
type User {
property foo -> bool;
property bar -> bool;
};
""",
r"""
type User {
property foo -> bool {
rewrite insert using (
__specified__.bar and __specified__.baz
);
};
property bar -> bool {
rewrite insert using (
__specified__.foo and __specified__.baz
);
};
property baz -> bool {
rewrite insert using (
__specified__.foo and __specified__.bar
);
};
};
""",
r"""
type User {
property foo -> bool;
property bar -> bool;
property baz -> bool;
};
""",
r"""
""",
])

def test_schema_migrations_implicit_type_01(self):
self._assert_migration_equivalence([
r"""
Expand Down

0 comments on commit adf356a

Please sign in to comment.