Keep tests in line with spec changes

This commit is contained in:
Justin Abrahms 2022-08-29 11:18:46 -07:00
parent 50225388af
commit 7fa39bcd04
No known key found for this signature in database
GPG Key ID: 599E2E12011DC474
4 changed files with 5 additions and 8 deletions

View File

@ -12,7 +12,7 @@ def _demarkdown(t):
def get_spec(force_refresh=False):
spec_path = './specification.json'
data = ""
if os.path.exists(spec_path):
if os.path.exists(spec_path) and not force_refresh:
with open(spec_path) as f:
data = ''.join(f.readlines())
else:

View File

@ -225,7 +225,7 @@ class FlagEvaluationSpecTest implements HookFixtures {
}
@Specification(number="3.2.1", text="The API, Client and invocation MUST have a method for supplying evaluation context.")
@Specification(number="3.2.2", text="Evaluation context MUST be merged in the order: API (global) - client - invocation, with duplicate values being overwritten.")
@Specification(number="3.2.2", text="Evaluation context MUST be merged in the order: API (global; lowest precedence) - client - invocation - before hooks (highest precedence), with duplicate values being overwritten.")
@Test void multi_layer_context_merges_correctly() {
OpenFeatureAPI api = OpenFeatureAPI.getInstance();
DoSomethingProvider provider = new DoSomethingProvider();
@ -266,9 +266,6 @@ class FlagEvaluationSpecTest implements HookFixtures {
@Specification(number="1.1.6", text="The client creation function MUST NOT throw, or otherwise abnormally terminate.")
@Test void constructor_does_not_throw() {}
@Specification(number="1.6.1", text="The client SHOULD transform the evaluation context using the provider's context transformer function if one is defined, before passing the result of the transformation to the provider's flag resolution functions.")
@Test void not_doing_unless_someone_has_a_good_reason_why() {}
@Specification(number="1.4.11", text="The client SHOULD provide asynchronous or non-blocking mechanisms for flag evaluation.")
@Test void one_thread_per_request_model() {}
}

View File

@ -470,7 +470,7 @@ public class HookSpecTest implements HookFixtures {
}
@Specification(number="4.3.4", text="When before hooks have finished executing, any resulting evaluation context MUST be merged with the existing evaluation context in the following order: before-hook (highest precedence), invocation, client, api (lowest precedence).")
@Specification(number="4.3.4", text="When before hooks have finished executing, any resulting evaluation context MUST be merged with the existing evaluation context.")
@Test void mergeHappensCorrectly() {
EvaluationContext hookCtx = new EvaluationContext();
hookCtx.add("test", "works");

View File

@ -19,8 +19,8 @@ public class ProviderSpecTest {
"flag resolution structure's value field with the resolved flag value.")
@Specification(number="2.2", text="The feature provider interface MUST define methods to resolve " +
"flag values, with parameters flag key (string, required), default value " +
"(boolean | number | string | structure, required), evaluation context (optional), and " +
"evaluation options (optional), which returns a flag resolution structure.")
"(boolean | number | string | structure, required) and evaluation context (optional), " +
"which returns a flag resolution structure.")
@Specification(number="2.9.1", text="The flag resolution structure SHOULD accept a generic " +
"argument (or use an equivalent language feature) which indicates the type of the wrapped value field.")
@Test void flag_value_set() {