Add usage tests for check-ufo-sources and check-specification
@@ -11,7 +11,8 @@ def test_list_subcommands_has_all_scripts():
commands_dir = os.path.dirname(fontbakery.commands.__file__)
scripts = [
- f.rstrip(".py").replace("_", "-") for f in os.listdir(commands_dir)
+ f.rstrip(".py").replace("_", "-")
+ for f in os.listdir(commands_dir)
if (f.endswith(".py") and not f.startswith('_'))
]
subcommands = subprocess.check_output(['fontbakery',
@@ -25,3 +26,19 @@ def test_command_check_googlefonts():
with pytest.raises(subprocess.CalledProcessError):
subprocess.check_output(["fontbakery", "check-googlefonts"])
+
+
+def test_command_check_specification():
+ """Test if `fontbakery check-specification` can run successfully`."""
+ subprocess.check_output(["fontbakery", "check-specification", "-h"])
+
+ with pytest.raises(subprocess.CalledProcessError):
+ subprocess.check_output(["fontbakery", "check-specification"])
+
+
+def test_command_check_ufo_sources():
+ """Test if `fontbakery check-ufo-sources` can run successfully`."""
+ subprocess.check_output(["fontbakery", "check-ufo-sources", "-h"])
+
+ with pytest.raises(subprocess.CalledProcessError):
+ subprocess.check_output(["fontbakery", "check-ufo-sources"])
