mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Changed mach test to use generated json file of properties
This commit is contained in:
parent
8e2af4cf05
commit
5098ad7d93
2 changed files with 9 additions and 3 deletions
|
@ -23,7 +23,6 @@ properties = dict(
|
||||||
)
|
)
|
||||||
|
|
||||||
json_dump = json.dumps(properties, indent=4)
|
json_dump = json.dumps(properties, indent=4)
|
||||||
print(json_dump)
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Resolve path to doc directory and write CSS properties and JSON.
|
# Resolve path to doc directory and write CSS properties and JSON.
|
||||||
|
|
|
@ -163,10 +163,17 @@ class MachCommands(CommandBase):
|
||||||
@CommandArgument('test_name', nargs=argparse.REMAINDER,
|
@CommandArgument('test_name', nargs=argparse.REMAINDER,
|
||||||
help="Only run tests that match this pattern or file path")
|
help="Only run tests that match this pattern or file path")
|
||||||
def test_unit(self, test_name=None, package=None):
|
def test_unit(self, test_name=None, package=None):
|
||||||
properties = json.loads(subprocess.check_output([
|
subprocess.check_output([
|
||||||
sys.executable,
|
sys.executable,
|
||||||
path.join(self.context.topdir, "components", "style", "list_properties.py")
|
path.join(self.context.topdir, "components", "style", "list_properties.py")
|
||||||
]))
|
])
|
||||||
|
|
||||||
|
this_file = style = os.path.dirname(__file__)
|
||||||
|
servo_doc_path = os.path.abspath(os.path.join(this_file, '../', '../', 'target', 'doc', 'servo'))
|
||||||
|
|
||||||
|
with open(os.path.join(servo_doc_path, 'css-properties.json'), 'r') as property_file:
|
||||||
|
properties = json.loads(property_file.read())
|
||||||
|
|
||||||
assert len(properties) >= 100
|
assert len(properties) >= 100
|
||||||
assert "margin-top" in properties
|
assert "margin-top" in properties
|
||||||
assert "margin" in properties
|
assert "margin" in properties
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue