コード例 #1
0
def step_impl(context: Context, relation_label: str, role_label: str,
              is_abstract):
    is_abstract = parse_bool(is_abstract)
    assert_that(
        context.tx().concepts().get_relation_type(relation_label).as_remote(
            context.tx()).get_relates(role_label).as_remote(
                context.tx()).is_abstract(), is_(is_abstract))
コード例 #2
0
def step_impl(context: Context, root_label: RootLabel, type_label: str,
              is_abstract):
    is_abstract = parse_bool(is_abstract)
    thing_type = context.get_thing_type(root_label, type_label)
    if is_abstract:
        thing_type.as_remote(context.tx()).set_abstract()
    else:
        thing_type.as_remote(context.tx()).unset_abstract()
コード例 #3
0
ファイル: graql_steps.py プロジェクト: VladGan/client-python
 def check(self, attribute: AttributeSubtype):
     if attribute.is_boolean():
         return attribute.get_value() == parse_bool(self.value)
     elif attribute.is_long():
         return attribute.get_value() == parse_int(self.value)
     elif attribute.is_double():
         return attribute.get_value() == parse_float(self.value)
     elif attribute.is_string():
         return attribute.get_value() == self.value
     elif attribute.is_datetime():
         return attribute.get_value() == parse_datetime(self.value)
     else:
         raise ValueError("Unrecognised value type " + str(type(attribute)))
コード例 #4
0
 def check(self, attribute: Attribute):
     if attribute.is_boolean():
         return ConceptMatchResult.of(parse_bool(self.value),
                                      attribute.get_value())
     elif attribute.is_long():
         return ConceptMatchResult.of(parse_int(self.value),
                                      attribute.get_value())
     elif attribute.is_double():
         return ConceptMatchResult.of(parse_float(self.value),
                                      attribute.get_value())
     elif attribute.is_string():
         return ConceptMatchResult.of(self.value, attribute.get_value())
     elif attribute.is_datetime():
         return ConceptMatchResult.of(parse_datetime(self.value),
                                      attribute.get_value())
     else:
         raise ValueError("Unrecognised value type " + str(type(attribute)))
コード例 #5
0
def step_impl(context: Context, is_null):
    is_null = parse_bool(is_null)
    for session in context.sessions:
        assert_that(session is None, is_(is_null))
コード例 #6
0
def step_impl(context: Context, is_open):
    is_open = parse_bool(is_open)
    for future_session in context.sessions_parallel:
        assert_that(future_session.result().is_open(), is_(is_open))
コード例 #7
0
def step_impl(context: Context, is_null):
    is_null = parse_bool(is_null)
    for future_session in context.sessions_parallel:
        assert_that(future_session.result() is None, is_(is_null))
コード例 #8
0
def step_impl(context: Context, is_open):
    is_open = parse_bool(is_open)
    for session in context.sessions:
        assert_that(session.is_open(), is_(is_open))
コード例 #9
0
def step_impl(context: Context, relation_label: str, role_label: str, is_null):
    is_null = parse_bool(is_null)
    assert_that(
        context.tx().concepts().get_relation_type(relation_label).as_remote(
            context.tx()).get_relates(role_label) is None, is_(is_null))
コード例 #10
0
def step_impl(context: Context, var: str, is_deleted):
    is_deleted = parse_bool(is_deleted)
    assert_that(
        context.get(var).as_remote(context.tx()).is_deleted(), is_(is_deleted))
コード例 #11
0
def step_impl(context: Context, var: str, is_null):
    is_null = parse_bool(is_null)
    assert_that(context.get(var) is None, is_(is_null))
コード例 #12
0
def step_impl(context: Context, root_label: RootLabel, type_label: str,
              is_abstract):
    is_abstract = parse_bool(is_abstract)
    assert_that(
        context.get_thing_type(root_label, type_label).as_remote(
            context.tx()).is_abstract(), is_(is_abstract))
コード例 #13
0
def step_impl(context: Context, root_label: RootLabel, type_label: str,
              is_null):
    is_null = parse_bool(is_null)
    assert_that(
        context.get_thing_type(root_label, type_label) is None, is_(is_null))
コード例 #14
0
def step_impl(context: Context, is_null):
    is_null = parse_bool(is_null)
    for_each_session_transactions_are(context, lambda tx: assert_transaction_null(tx, is_null))
コード例 #15
0
def step_impl(context: Context, is_open):
    is_open = parse_bool(is_open)
    for_each_session_in_parallel_transactions_in_parallel_are(context, lambda tx: assert_transaction_open(tx, is_open))