Commit e5d2ed3f authored by Andrea Il Grande's avatar Andrea Il Grande
Browse files

updated initial_setup.py

parent 9c771620
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource
Resource            ${EXECDIR}/resources/MockServerUtils.resource

Test Setup         Setup Initial Context Source Registration And Start Context Source Mock Server
Test Setup         Setup Registration And Start Context Source Mock Server
Test Teardown      Delete Created Registration And Stop Context Source Mock Server


@@ -34,7 +34,7 @@ D001_02_inc Request to create an entity with a malformed id on both Context Brok
    Should Be Empty    ${response_query.json()}

*** Keywords ***
Setup Initial Context Source Registration And Start Context Source Mock Server
Setup Registration And Start Context Source Mock Server
    ${context_source_registration_id}=    Generate Random Entity Id    ${registration_id_prefix}
    Set Suite Variable    ${context_source_registration_id}
    ${registration_payload}=    Prepare Context Source Registration From File
+13 −44
Original line number Diff line number Diff line
@@ -42,12 +42,10 @@ class InitialSetup:
            'Create Initial hosted @context': InitialSetup.create_hosted_context(),
            'Create Initial @context condition from an external server': InitialSetup.create_from_external_server(),
            'Delete core context and reload it': InitialSetup.delete_core_context(),
            'Setup Entities And Registration': InitialSetup.init_entities_and_csr(),
            'Setup Entity Id And Registration': InitialSetup.init_eid_and_csr(),
            'Setup Entity On Remote And Registration': InitialSetup.init_remote_entity_and_csr(),
            'Setup Entity On Local And Registration': InitialSetup.init_local_entity_and_csr(),
            'Create Entities With Different Payloads And Registration': InitialSetup.init_diff_entities_and_csr(),
            'Create Initial Cached @context from entity': InitialSetup.init_cached_conctext()
            'Setup Entity Id And Registration And Start Context Source Mock Server': InitialSetup.init_eid_and_csr_and_ms(),
            'Setup Registration And Start Context Source Mock Server': InitialSetup.init_csr_and_ms(),
            'Create Entity And Registration On The Context Broker And Start Context Source Mock Server': InitialSetup.init_local_entity_and_csr_and_ms(),
            'Create Initial Cached @context from entity': InitialSetup.init_cached_context()
        }

        self.folder_test_suites = dirname(dirname(dirname(__file__)))
@@ -225,7 +223,7 @@ class InitialSetup:
        return data

    @staticmethod
    def init_cached_conctext():
    def init_cached_context():
        data = '''with {
    the SUT containing a cached context from creating an entity.
        }'''
@@ -274,44 +272,30 @@ class InitialSetup:
        return data
    
    @staticmethod
    def init_entities_and_csr() -> str:
        data = '''with {
    the SUT being in the "initial state" and
    the SUT containing an initial Entity ${entity} on both the Context Broker and Context Source
        with an id set to ${entity_id}
        and payload set to ${entity_payload_filename}
    and the SUT containing a Context Source Registration 
        with id equal to ${registration_id}
        and payload set to ${registration_payload_file_path}
}'''
        return data
    
    @staticmethod
    def init_eid_and_csr() -> str:
    def init_eid_and_csr_and_ms() -> str:
        data = '''with {
    the SUT being in the "initial state" and
    the SUT containing an initial Entity id set to ${entity_id}
    and the SUT containing a Context Source Registration 
        with id equal to ${registration_id}
        and payload set to ${registration_payload_file_path}
    and the SUT containing a Context Source Mock Server
}'''
        return data
    
    @staticmethod
    def init_remote_entity_and_csr() -> str:
    def init_csr_and_ms() -> str:
        data = '''with {
    the SUT being in the "initial state" and
    the SUT containing an initial Entity ${entity} on the Context Source
        with an id set to ${entity_id}
        and payload set to ${entity_payload_filename}
    and the SUT containing a Context Source Registration 
    the SUT containing a Context Source Registration 
        with id equal to ${registration_id}
        and payload set to ${registration_payload_file_path}
    and the SUT containing a Context Source Mock Server
}'''
        return data

    @staticmethod
    def init_local_entity_and_csr() -> str:
    def init_local_entity_and_csr_and_ms() -> str:
        data = '''with {
    the SUT being in the "initial state" and
    the SUT containing an initial Entity ${entity} on the Context Broker
@@ -320,22 +304,7 @@ class InitialSetup:
    and the SUT containing a Context Source Registration 
        with id equal to ${registration_id}
        and payload set to ${registration_payload_file_path}
}'''
        return data
    
    @staticmethod
    def init_diff_entities_and_csr() -> str:
        data = '''with {
    the SUT being in the "initial state" and
    the SUT containing an initial Entity ${entity} on the Context Broker
        with an id set to ${entity_id}
        and payload set to ${entity_payload_filename}
    and the SUT containing an initial Entity ${entity} on the Context Source
        with an id set to ${entity_id}
        and payload set to ${entity_payload_filename2}
    and the SUT containing a Context Source Registration 
        with id equal to ${registration_id}
        and payload set to ${registration_payload_file_path}
    and the SUT containing a Context Source Mock Server
}'''
        return data