Skip to content

library/unittest.mock-examples 번역 #596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from

Conversation

kahee
Copy link

@kahee kahee commented May 31, 2019

안녕하세요.
373 library/unittest.mock-examples 번역 PR 요청드립니다.

몇가지 궁금한 점과 의논하고 싶은 것이 있는데요.

  1. #: ../Doc/library/unittest.mock-examples.rst:40 build하고 봤을때 번역이 이부분만 안되어 있습니다.
    build 할때 에러도 없어서 제가 어느부분을 놓쳤는지 잘 모르겠네요.

  2. assertion, assert 번역
    현재 한국어로 번역하면 '확인'이라는 단어가 가장 어울리는 것 같았습니다.
    그러나 '확인'이라는 단어만으로는 위 두 단어의 ��미를 온전히 못살리는 것 같아서
    우선은 '어서션, 어서트' 이렇게 번역을 해놓았는데 이부분에 대해서 어떻게 생각하시는지 궁금합니다.

  3. 목업(mock up), 몽키패치(monkey patch) 등 그외 용어
    현재 한국어로 번역이 어려운 단어의 경우 위에 같이 번역을 했는데 이에 대해서도 어떻게 생각하시는지 의견을 구하고 싶���니다.

이번에도 잘 부탁드립니다 :)

@flowdas
Copy link
Collaborator

flowdas commented May 31, 2019

수고하셨습니다. 리뷰는 이번 주말쯤 시작할 수 있을 것 같습니다. 질문에 대한 답변도 그 때 쯤으로 미루려고 합니다.

하지만 첫번째 질문은 간단해서 답변드립니다. msgid 가 편집 과정에서 변경된 듯 합니다. 지금 이 페이지의 File Changed 탭에 나오는 diff 를 보면 스페이스하나가 더 들어가 있네요. 원문에 있는 텍스트의 msgid 를 po 파일에서 찾지 못해 번역이 없는 것으로 판단했습니다. 저도 가끔 실수하는 문제입니다. 만약 이 문제가 편집 과정이 아니라 format 명령으로 인한 것이면 알려주시기 바랍니다.

@flowdas
Copy link
Collaborator

flowdas commented May 31, 2019

빌드해보면 warning 이 몇 개 나옵니다. 증분 빌드를 하면 처음에만 나오고, 그 후로는 나오지 않습니다. -r 옵션을 주면 다시 나올겁니다.

/python-docs-ko/python-docs-ko/tmp/Doc/library/unittest.mock-examples.rst:736:<translated>:1: WARNING: Inline literal start-string without end-string.
/python-docs-ko/python-docs-ko/tmp/Doc/library/unittest.mock-examples.rst:812:<translated>:1: WARNING: Inline literal start-string without end-string.
/python-docs-ko/python-docs-ko/tmp/Doc/library/unittest.mock-examples.rst:818:<translated>:1: WARNING: Inline literal start-string without end-string.
/python-docs-ko/python-docs-ko/tmp/Doc/library/unittest.mock-examples.rst:1118:<translated>:1: WARNING: Inline literal start-string without end-string.
/python-docs-ko/python-docs-ko/tmp/Doc/library/unittest.mock-examples.rst:736:<translated>:1: WARNING: Inline literal start-string without end-string.
/python-docs-ko/python-docs-ko/tmp/Doc/library/unittest.mock-examples.rst:812:<translated>:1: WARNING: Inline literal start-string without end-string.
/python-docs-ko/python-docs-ko/tmp/Doc/library/unittest.mock-examples.rst:818:<translated>:1: WARNING: Inline literal start-string without end-string.
/python-docs-ko/python-docs-ko/tmp/Doc/library/unittest.mock-examples.rst:1118:<translated>:1: WARNING: Inline literal start-string without end-string.
@flowdas
Copy link
Collaborator

flowdas commented Jun 6, 2019

assert 는 파이썬 키워드를 뜻하는 것이 확실할 때는 번역하지 않고 assert를 사용합니다. 하지만 이 문서에는 그런 용법은 없는 것으로 보입니다. 언어 레퍼런스에서는 assertion 을 어서션이라고 표기한 곳이 한 곳 있고, (다른 분이 번역하신) unittest 모듈에서는 assert 가 키워드로 사용되지 않은 곳에서도 대부분 assert 라고 영문 표기를 그대로 사용했습니다. 실제 어서션하는 메서드가 모두 assert 로 시작하기 때문에 뜻은 통할 것으로 보고 그냥 두었습니다. 제 의견은 명사로 쓰일 때는 "어서션" 으로, 동사로 쓰일 때는 "assert" 나 "어서트" 모두 받아들일 수 있을듯합니다.

monkey patch 는 "몽키패치" 가 널리 사용되는 표현인듯합니다.

mock up 은 동사, mock-up 은 명사로 사용되는데, "목업" 이라는 번역어가 흔히 통용되기는 하지만, 용법이 명사쪽으로 기울어져있지 않은가 하는 것이 제 의견입니다. 동사로 쓰일 때는 "모킹하다" 가 어떨까요? "목업하다" 를 선택하셔도 반대하지는 않겠습니다.

@kahee
Copy link
Author

kahee commented Jun 7, 2019

제가 이제서야 답변 주신걸 확인했네요.
의견 주신 것처럼 assert 는 명사, 동사 통일성을 주기 위해 한국어로 번역하는 걸로 수정하는게 나을것 같네요.
그리고 mock up의 경우엔 모킹하다라고 해도 괜찮을것 같네요. 좋은 의견 주셔서 감사합니다.
주말에 warning 포함에서 수정하겠습니다.

Copy link
Collaborator

@flowdas flowdas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

양이 많아서 리뷰가 늦었습니다. 감사합니다.


#: ../Doc/library/unittest.mock-examples.rst:40
msgid ""
"Once the mock has been called its :attr:`~Mock.called` attribute is set "
"to ``True``. More importantly we can use the "
":meth:`~Mock.assert_called_with` or :meth:`~Mock.assert_called_once_with`"
" method to check that it was called with the correct arguments."
" method to check that it was called with the correct arguments."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

msgid 는 수정하지 않으셔야합니다. 스페이스 하나가 더 들어갔네요.

@@ -668,10 +817,12 @@ msgid ""
"``call_args_list``. This looks remarkably similar to the repr of the "
"``call_args_list``:"
msgstr ""
":data:`call` 도우미는 이러한 호출에 대한 어써션을 쉽게 만듭니다. 예상되는 호출 목록을 작성하여 "
"``call_args_list`` 와 비교할 수 있습니다. ``call_args_list``의 repr 과 매우 유사해 보입니다.:"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

``call_args_list``\\의

빌드할 때 경고 발생합니다.

@@ -719,20 +879,26 @@ msgid ""
"function makes a copy of the args and calls our ``new_mock`` with the "
"copy."
msgstr ""
"``copy_call_args`` mock이 호출 될 때 호출됩니다. 이것은 우리가 어서션할 새로운 mock을 반환합니다. "
"``side_effect`` 함수는 args 의 사본을 만들고 ``new_mock``을 사본으로 호출합니다."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

``new_mock``\\을

빌드할 때 경고 발생합니다.


#: ../Doc/library/unittest.mock-examples.rst:818
msgid ""
"If your mock is only going to be used once there is an easier way of "
"checking arguments at the point they are called. You can simply do the "
"checking inside a ``side_effect`` function."
msgstr ""
"mock을 한 번 사용하게 되면, 인자가 호출 되는 시점에서 인자를 확인하는 더 쉬운 방법이 있습니다. ``side_effect` "
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

``side_effect``

빌드할 때 경고 발생합니다.

@@ -941,19 +1159,24 @@ msgid ""
" separate mocks from a parent one. Calls to those child mock will then "
"all be recorded, in order, in the ``mock_calls`` of the parent:"
msgstr ""
"왜냐하면 mock은 ``mock_calls`` 에 있는 자식 mock에 대한 호출을 추적하고, mock의 임의 속성에 접근하면 자식"
" mock 을 생성하기 때문에 부모 mock 과 별도로 mock 을 생성할 수 있습니다. 그 자식 mock 호출은 모든 부모의 "
"``mock_calls` 에 순서대로 기록됩니다.:"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

``mock_calls``

빌드할 때 경고 발생합니다.

@@ -977,16 +1205,20 @@ msgid ""
"care about the order. In this case you can pass ``any_order=True`` to "
"``assert_has_calls``:"
msgstr ""
"때때로 mock은 여러번 호출 될 수 있으며, *일부* 호출에 대해서만 관심이 있습니다. 순서에 대해 신경쓰지 않을 수도 있습니다."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

약간 손봐야할 것 같습니다.

@@ -997,28 +1229,31 @@ msgid ""
"of the attributes of this object then we can create a matcher that will "
"check these attributes for us."
msgstr ""
"어떤 객체가 mock 에 전달 되는 것을 예상한다고 가정해 봅시다. 이 객체는 기본적으로 객체 동일성 (사용자 정의 클래스에 대한 "
"파이썬 기본값)을 바탕으로 동등을 비교합니다. :meth:`~Mock.assert_called_with` 사용하려면, 같은 객체를 "
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

조사

@@ -997,28 +1229,31 @@ msgid ""
"of the attributes of this object then we can create a matcher that will "
"check these attributes for us."
msgstr ""
"어떤 객체가 mock 에 전달 되는 것을 예상한다고 가정해 봅시다. 이 객체는 기본적으로 객체 동일성 (사용자 정의 클래스에 대한 "
"파이썬 기본값)을 바탕으로 동등을 비교합니다. :meth:`~Mock.assert_called_with` 사용하려면, 같은 객체를 "
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기서 exact 는 중요한 단어인 것 같습니다.

@@ -997,28 +1229,31 @@ msgid ""
"of the attributes of this object then we can create a matcher that will "
"check these attributes for us."
msgstr ""
"어떤 객체가 mock 에 전달 되는 것을 예상한다고 가정해 봅시다. 이 객체는 기본적으로 객체 동일성 (사용자 정의 클래스에 대한 "
"파이썬 기본값)을 바탕으로 동등을 비교합니다. :meth:`~Mock.assert_called_with` 사용하려면, 같은 객체를 "
"전달해야 합니다. 이 객체의 일부만 관심이 있는 경우 이러한 속성을 확인하는 matcher를 만들 수 있습니다."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

일부만 -> 일부 어트리뷰트에만

@@ -1029,12 +1264,15 @@ msgid ""
"they match then ``assert_called_with`` passes, and if they don't an "
":exc:`AssertionError` is raised:"
msgstr ""
"``Matcher`` 는 비교 함수와 비교할 ``Foo`` 객체로 인스턴스화 됩니다. ``assert_called_with`` 에서"
" ``Matcher`` 동등 메서드가 호출되어 mock 을 호출한 객체와우리가 만든 matcher 객체와 비교합니다 만약 일치하면 "
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

띄어쓰기

@kahee
Copy link
Author

kahee commented Jun 19, 2019

우선 빌드를 제대로 못해서 번거롭게 해드린 점 정말 죄송합니다.
위에 주신 피드백과 좀더 꼼꼼하게 보면서 다시 PR 요청 드리겠습니다.
감사합니다 :)

@kahee
Copy link
Author

kahee commented Mar 16, 2020

너무 오랫동안 제가 이걸 신경못쓰고 있었네요. 다음에 기회가 되면 진행하겠습니다.

@kahee kahee closed this Mar 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants