Skip to content

Commit 616da77

Browse files
committed
add logging for created build file in Command class
1 parent 31da0b7 commit 616da77

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

nak/command.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def build(self, parser=None):
6363
new_zip.write(file)
6464

6565
new_zip.close()
66+
logging.info(LOG_COLOR.INFO.format(message=f'Created build file with {destination_file.split("/")[-1]}.'))
6667
logging.info(LOG_COLOR.SUCCESS.format(message='Build successfully.'))
6768

6869
def push(self, parser=None):

tests/test_command.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from unittest.mock import MagicMock, call, mock_open, patch
33

44
from nak.command import Command
5-
from nak.settings import LOG_COLOR
5+
from nak.settings import LOG_COLOR, ZIP_DESTINATION_PATH
66

77

88
class TestCommand(unittest.TestCase):
@@ -106,9 +106,12 @@ def test_build_with_correct_directory_should_create_zip_file_correctly(
106106
call.write('test2.file'),
107107
call.close(),
108108
]
109+
110+
file_name = ZIP_DESTINATION_PATH.format(app_name="app-kit").split('/')[-1]
109111
assert log.output == [
110112
f"INFO:root:{LOG_COLOR.INFO.format(message='file: test1.file')}",
111113
f"INFO:root:{LOG_COLOR.INFO.format(message='file: test2.file')}",
114+
f"INFO:root:{LOG_COLOR.INFO.format(message=f'Created build file with {file_name}.')}",
112115
f"INFO:root:{LOG_COLOR.SUCCESS.format(message='Build successfully.')}"
113116
]
114117

0 commit comments

Comments
 (0)