adc7c4b7f75c0f2ba8fc157018b39efff0ba5218,tests/python/pants_test/util/test_keywords.py,TestKeywords,test_keyword_replaced,#TestKeywords#,19

Before Change


      }
    """).encode("utf-8"))
    m = mock_open(read_data=thrift_contents)
    with patch("__builtin__.open", m, create=True):
      replace_python_keywords_in_file("thrift_dummmy.thrift")
      expected_open_call_list = [call("thrift_dummmy.thrift"), call("thrift_dummmy.thrift", "w")]
      m.call_args_list == expected_open_call_list
      mock_file_handle = m()
      mock_file_handle.write.assert_called_once_with(expected_replaced_contents)

  def test_non_keyword_file(self):
    thrift_contents = dedent("""
      namespace py gen.twitter.tweetypie.tweet
      struct UrlEntity {

After Change


      tmp.flush()
      pants.util.keywords.replace_python_keywords_in_file(tmp.name)
      with open(tmp.name) as f:
        self.assertEquals(expected_replaced_contents, f.read())

  def test_non_keyword_file(self):
    thrift_contents = dedent("""
      namespace py gen.twitter.tweetypie.tweet
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: pantsbuild/pants
Commit Name: adc7c4b7f75c0f2ba8fc157018b39efff0ba5218
Time: 2015-01-29
Author: dturner@twopensource.com
File Name: tests/python/pants_test/util/test_keywords.py
Class Name: TestKeywords
Method Name: test_keyword_replaced


Project Name: pantsbuild/pants
Commit Name: adc7c4b7f75c0f2ba8fc157018b39efff0ba5218
Time: 2015-01-29
Author: dturner@twopensource.com
File Name: tests/python/pants_test/util/test_keywords.py
Class Name: TestKeywords
Method Name: test_non_keyword_file


Project Name: mlflow/mlflow
Commit Name: 06e9433720845ab9f12e7ea0d8a8982123f093c6
Time: 2020-12-18
Author: 39497902+dbczumar@users.noreply.github.com
File Name: tests/autologging/fixtures.py
Class Name:
Method Name: test_mode_off


Project Name: mlflow/mlflow
Commit Name: 06e9433720845ab9f12e7ea0d8a8982123f093c6
Time: 2020-12-18
Author: 39497902+dbczumar@users.noreply.github.com
File Name: tests/autologging/fixtures.py
Class Name:
Method Name: test_mode_on