Updated docs
This commit is contained in:
@@ -7,13 +7,13 @@ from unittests_shared.cli_commands import CLICommands
|
||||
|
||||
|
||||
class GenerateTestCase(CommandTestCase):
|
||||
_project = 'test-console'
|
||||
_t_path = 'test'
|
||||
_project = "test-console"
|
||||
_t_path = "test"
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
CommandTestCase.setUpClass()
|
||||
CLICommands.new('console', cls._project, '--ab', '--s', '--venv')
|
||||
CLICommands.new("console", cls._project, "--ab", "--s", "--venv")
|
||||
|
||||
def setUp(self):
|
||||
os.chdir(PLAYGROUND_PATH)
|
||||
@@ -23,8 +23,8 @@ class GenerateTestCase(CommandTestCase):
|
||||
expected_path = f'generated_file{"_on_ready" if schematic == "event" else ""}{suffix}.py'
|
||||
|
||||
if path is not None:
|
||||
file = f'{path}/{file}'
|
||||
expected_path = f'{path}/{expected_path}'
|
||||
file = f"{path}/{file}"
|
||||
expected_path = f"{path}/{expected_path}"
|
||||
|
||||
CLICommands.generate(schematic, file)
|
||||
file_path = os.path.abspath(os.path.join(PLAYGROUND_PATH, expected_path))
|
||||
@@ -47,54 +47,54 @@ class GenerateTestCase(CommandTestCase):
|
||||
self.assertTrue(os.path.exists(file_path))
|
||||
|
||||
def test_abc(self):
|
||||
self._test_file('abc', '_abc')
|
||||
self._test_file('abc', '_abc', path=self._t_path)
|
||||
self._test_file('abc', '_abc', path=f'{self._t_path}/{self._t_path}')
|
||||
self._test_file_with_project('abc', '_abc', path=self._project)
|
||||
os.chdir(f'src/{String.convert_to_snake_case(self._project)}')
|
||||
self._test_file_with_project('abc', '_abc', path='test', enter=False)
|
||||
self._test_file("abc", "_abc")
|
||||
self._test_file("abc", "_abc", path=self._t_path)
|
||||
self._test_file("abc", "_abc", path=f"{self._t_path}/{self._t_path}")
|
||||
self._test_file_with_project("abc", "_abc", path=self._project)
|
||||
os.chdir(f"src/{String.convert_to_snake_case(self._project)}")
|
||||
self._test_file_with_project("abc", "_abc", path="test", enter=False)
|
||||
|
||||
def test_class(self):
|
||||
self._test_file('class', '')
|
||||
self._test_file('class', '', path=self._t_path)
|
||||
self._test_file_with_project('class', '', path=self._project)
|
||||
self._test_file("class", "")
|
||||
self._test_file("class", "", path=self._t_path)
|
||||
self._test_file_with_project("class", "", path=self._project)
|
||||
|
||||
def test_enum(self):
|
||||
self._test_file('enum', '_enum')
|
||||
self._test_file('enum', '_enum', path=self._t_path)
|
||||
self._test_file_with_project('enum', '_enum', path=self._project)
|
||||
os.chdir(f'src/{String.convert_to_snake_case(self._project)}')
|
||||
self._test_file_with_project('enum', '_enum', path='test', enter=False)
|
||||
self._test_file("enum", "_enum")
|
||||
self._test_file("enum", "_enum", path=self._t_path)
|
||||
self._test_file_with_project("enum", "_enum", path=self._project)
|
||||
os.chdir(f"src/{String.convert_to_snake_case(self._project)}")
|
||||
self._test_file_with_project("enum", "_enum", path="test", enter=False)
|
||||
|
||||
def test_pipe(self):
|
||||
self._test_file('pipe', '_pipe')
|
||||
self._test_file('pipe', '_pipe', path=self._t_path)
|
||||
self._test_file_with_project('pipe', '_pipe', path=self._project)
|
||||
self._test_file("pipe", "_pipe")
|
||||
self._test_file("pipe", "_pipe", path=self._t_path)
|
||||
self._test_file_with_project("pipe", "_pipe", path=self._project)
|
||||
|
||||
def test_service(self):
|
||||
self._test_file('service', '_service')
|
||||
self._test_file_with_project('service', '_service', path=self._project)
|
||||
self._test_file("service", "_service")
|
||||
self._test_file_with_project("service", "_service", path=self._project)
|
||||
|
||||
def test_settings(self):
|
||||
self._test_file('settings', '_settings')
|
||||
self._test_file_with_project('settings', '_settings', path=self._project)
|
||||
self._test_file("settings", "_settings")
|
||||
self._test_file_with_project("settings", "_settings", path=self._project)
|
||||
|
||||
def test_test_case(self):
|
||||
self._test_file('test-case', '_test_case')
|
||||
self._test_file_with_project('test-case', '_test_case', path=self._project)
|
||||
self._test_file("test-case", "_test_case")
|
||||
self._test_file_with_project("test-case", "_test_case", path=self._project)
|
||||
|
||||
def test_thread(self):
|
||||
self._test_file('thread', '_thread')
|
||||
self._test_file_with_project('thread', '_thread', path=self._project)
|
||||
self._test_file("thread", "_thread")
|
||||
self._test_file_with_project("thread", "_thread", path=self._project)
|
||||
|
||||
def test_validator(self):
|
||||
self._test_file('validator', '_validator')
|
||||
self._test_file_with_project('validator', '_validator', path=self._project)
|
||||
self._test_file("validator", "_validator")
|
||||
self._test_file_with_project("validator", "_validator", path=self._project)
|
||||
|
||||
def test_discord_command(self):
|
||||
self._test_file('command', '_command')
|
||||
self._test_file_with_project('command', '_command', path=self._project)
|
||||
self._test_file("command", "_command")
|
||||
self._test_file_with_project("command", "_command", path=self._project)
|
||||
|
||||
def test_discord_event(self):
|
||||
self._test_file('event', '_event')
|
||||
self._test_file_with_project('event', '_event', path=self._project)
|
||||
self._test_file("event", "_event")
|
||||
self._test_file_with_project("event", "_event", path=self._project)
|
||||
|
||||
Reference in New Issue
Block a user