os-threat / Stix-ORM

GNU Affero General Public License v3.0
4 stars 0 forks source link

Error with translation campaign #30

Open dfjosullivan opened 1 year ago

dfjosullivan commented 1 year ago

See test in test_refactor

    def test_translation_campaign(self, setup_teardown, generate_connection):
        typedb_sink = TypeDBSink(connection=generate_connection,
                                 clear=True,
                                 import_type=import_type)
        json_text = self.get_json_from_file(translation_campaign_path())

        result = typedb_sink.add(json_text)
        self.validate_successful_result(result)

Error

Traceback (most recent call last):
  File "C:\Users\denis\PycharmProjects\Stix-ORM\stixorm\module\typedb.py", line 366, in __generate_instructions
    typeql_object_result = self.__generate_typeql_object(stix_dict)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\denis\PycharmProjects\Stix-ORM\stixorm\module\typedb.py", line 346, in __generate_typeql_object
    stix_obj = parse(stix_dict, False, self.import_type)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\denis\PycharmProjects\Stix-ORM\stixorm\module\parsing\parse_objects.py", line 43, in parse
    obj = dict_to_stix(obj, allow_custom, import_type)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\denis\PycharmProjects\Stix-ORM\stixorm\module\parsing\parse_objects.py", line 170, in dict_to_stix
    raise ParseError(f'the object is not known, and custom is not enabled')
stix2.exceptions.ParseError: the object is not known, and custom is not enabled
dfjosullivan commented 1 year ago

Language Content content cannot be parsed by parse_objects.py and will error at line 170

raise ParseError(f'the object is not known, and custom is not enabled')
{'type': 'language-content', 'id': 'language-content--b86bd89f-98bb-4fa9-8cb2-9ad421da981d', 'spec_version': '2.1', 'created': '2017-02-08T21:31:22.007Z', 'modified': '2017-02-08T21:31:22.007Z', 'object_ref': 'campaign--12a111f0-b824-4baf-a224-83b80237a094', 'object_modified': '2017-02-08T21:31:22.007Z', 'contents': {'de': {'name': 'Bank Angriff', 'description': 'Weitere Informationen über Banküberfall'}, 'fr': {'name': 'Attaque Bank', 'description': "Plus d'informations sur la crise bancaire"}}}
brettforbes commented 1 year ago

I will do this, but i am putting it on-hold till after we have demos, as we dont need this for the demos and they take priority