def test_get_remote_md_file_origin(self): hello_world_readme = tools.get_remote_file( 'Packs/HelloWorld/README.md', 'master') assert hello_world_readme == {}
def test_get_remote_file_sanity(self): hello_world_yml = tools.get_remote_file( 'Packs/HelloWorld/Integrations/HelloWorld/HelloWorld.yml') assert hello_world_yml assert hello_world_yml['commonfields']['id'] == 'HelloWorld'
def test_get_remote_file_invalid(self): invalid_yml = tools.get_remote_file('Integrations/File/File.yml', '19.10.0') assert not invalid_yml
def test_get_remote_file_invalid_origin_branch(self): invalid_yml = tools.get_remote_file('Integrations/Gmail/Gmail.yml', 'origin/NoSuchBranch') assert not invalid_yml
def test_get_remote_file_origin_tag(self): gmail_yml = tools.get_remote_file('Integrations/Gmail/Gmail.yml', 'origin/19.10.0') assert gmail_yml assert gmail_yml['commonfields']['id'] == 'Gmail'
def test_get_remote_file_sanity(self): gmail_yml = tools.get_remote_file('Integrations/Gmail/Gmail.yml') assert gmail_yml assert gmail_yml['commonfields']['id'] == 'Gmail'
from demisto_sdk.commands.common.constants import (PACKS_PACK_META_FILE_NAME, XSOAR_AUTHOR, XSOAR_SUPPORT, XSOAR_SUPPORT_URL, ContentItems) from demisto_sdk.commands.common.content.objects.abstract_objects import \ JSONObject from demisto_sdk.commands.find_dependencies.find_dependencies import \ PackDependencies from packaging.version import Version, parse from wcmatch.pathlib import Path DATETIME_FORMAT = '%Y-%m-%dT%H:%M:%SZ' PARTNER_SUPPORT = 'partner' XSOAR_CERTIFIED = 'certified' XSOAR_EULA_URL = 'https://github.com/demisto/content/blob/master/LICENSE' CORE_PACKS_LIST = tools.get_remote_file( 'Tests/Marketplace/core_packs_list.json') or [] class PackMetaData(JSONObject): def __init__(self, path: Union[Path, str]): super().__init__(path) self._name: str = '' self._id: str = '' self._description: str = '' self._created: datetime = datetime.utcnow() self._updated: datetime = datetime.utcnow() self._legacy: bool = True self._support: str = '' self._eulaLink: str = 'https://github.com/demisto/content/blob/master/LICENSE' self._email: str = '' self._url: str = ''
def test_get_remote_file_content_sanity(self): hello_world_py = tools.get_remote_file('Packs/HelloWorld/Integrations/HelloWorld/HelloWorld.py', return_content=True) assert hello_world_py
def test_get_remote_file_origin(self): hello_world_yml = tools.get_remote_file( 'Packs/HelloWorld/Integrations/HelloWorld/HelloWorld.yml', 'demisto/master') assert hello_world_yml assert hello_world_yml['commonfields']['id'] == 'HelloWorld'