test: complete grpc data solution validation
This commit is contained in:
@@ -30,6 +30,18 @@ class UnitPhaseRunnerTests(unittest.TestCase):
|
||||
self.result_mode = "fresh"
|
||||
self.result_classes = None
|
||||
|
||||
def test_only_declared_network_free_integration_guards_can_run_as_units(self):
|
||||
project, guards = next(iter(runner.INTEGRATION_UNIT_GUARDS.items()))
|
||||
path = self.root / project; path.parent.mkdir(parents=True); path.touch()
|
||||
guard = next(iter(guards))
|
||||
record = {"project": project, "filter": "Category=Integration", "new_classes": [guard], "existing_classes": []}
|
||||
with self.assertRaises(runner.GateError): runner.selected_records({"P12": [record]}, "P12", self.root, None)
|
||||
record["integration_unit_guards"] = True
|
||||
selected = runner.selected_records({"P12": [record]}, "P12", self.root, None)[0]
|
||||
self.assertEqual(selected["filter"], "Category=Unit&(FullyQualifiedName~." + guard + ".)")
|
||||
record["existing_classes"] = ["LiveNetworkTests"]
|
||||
with self.assertRaises(runner.GateError): runner.selected_records({"P12": [record]}, "P12", self.root, None)
|
||||
|
||||
def fake(self, argv, **kwargs):
|
||||
self.calls.append((argv, kwargs))
|
||||
if argv[0] == "git":
|
||||
@@ -86,6 +98,12 @@ class UnitPhaseRunnerTests(unittest.TestCase):
|
||||
with self.assertRaisesRegex(runner.GateError, "zero"):
|
||||
self.run_gate()
|
||||
|
||||
def test_discovery_preserves_unicode_control_in_theory_arguments(self):
|
||||
case = 'Example.OracleDialectTests.QuoteIdentifier(ident: "x\u0085y")'
|
||||
following = "Example.OracleDialectTests.Ordinary"
|
||||
listing = f"The following Tests are available:\r\n {case}\r\n {following}\r\n"
|
||||
self.assertEqual([following, case], runner.discover_names(listing))
|
||||
|
||||
def test_missing_new_class_cannot_be_masked_by_existing_class(self):
|
||||
self.listing = "The following Tests are available:\n Example.OldTests.Works\n"
|
||||
with self.assertRaisesRegex(runner.GateError, "NewTests"):
|
||||
|
||||
Reference in New Issue
Block a user