Skip to content

Commit

Permalink
fix v5 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bckohan committed Dec 26, 2023
1 parent e9c0520 commit 9a430bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
14 changes: 7 additions & 7 deletions django_typer/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_call_command_stdout(self):

def test_get_version(self):
self.assertEqual(
run_command("basic", "--version").strip(), django.get_version()
str(run_command("basic", "--version")).strip(), django.get_version()
)

def test_call_direct(self):
Expand Down Expand Up @@ -183,16 +183,16 @@ def test_call_command_stdout(self):

def test_get_version(self):
self.assertEqual(
run_command("multi", "--version").strip(), django.get_version()
str(run_command("multi", "--version")).strip(), django.get_version()
)
self.assertEqual(
run_command("multi", "cmd1", "--version").strip(), django.get_version()
str(run_command("multi", "cmd1", "--version")).strip(), django.get_version()
)
self.assertEqual(
run_command("multi", "sum", "--version").strip(), django.get_version()
str(run_command("multi", "sum", "--version")).strip(), django.get_version()
)
self.assertEqual(
run_command("multi", "cmd3", "--version").strip(), django.get_version()
str(run_command("multi", "cmd3", "--version")).strip(), django.get_version()
)

def test_call_direct(self):
Expand Down Expand Up @@ -439,10 +439,10 @@ def test_call_command_stdout(self):

def test_get_version(self):
self.assertEqual(
run_command(self.cmd_name, "--version").strip(), django.get_version()
str(run_command(self.cmd_name, "--version")).strip(), django.get_version()
)
self.assertEqual(
run_command(self.cmd_name, "6", self.cmd_name, "--version").strip(),
str(run_command(self.cmd_name, "6", self.cmd_name, "--version")).strip(),
django.get_version(),
)

Expand Down
4 changes: 3 additions & 1 deletion django_typer/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ def print_version(context, _, value):
command when --version is specified.
"""
if value:
echo(context.django_command.get_version())
context.django_command.stdout.write(
context.django_command.get_version()
)
sys.exit()


Expand Down

0 comments on commit 9a430bd

Please sign in to comment.