adc7c4b7f75c0f2ba8fc157018b39efff0ba5218,tests/python/pants_test/util/test_keywords.py,TestKeywords,test_non_keyword_file,#TestKeywords#,43

Before Change


      }
    """)
    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(thrift_contents)

After Change


        5: i16 fromsuffix
      }
    """)
    with temporary_file() as tmp:
      tmp.write(thrift_contents)
      tmp.flush()
      pants.util.keywords.replace_python_keywords_in_file(tmp.name)
      with open(tmp.name) as f:
        self.assertEquals(thrift_contents, f.read())
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

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_non_keyword_file


Project Name: nilearn/nilearn
Commit Name: a0d70d5a13d771ba944b4cf2a1c32226eafa393b
Time: 2015-11-04
Author: alexandre.abadie@inria.fr
File Name: nilearn/tests/test_numpy_conversions.py
Class Name:
Method Name: test_csv_to_array


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