File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,12 @@ def touch(self):
29
29
header .close ()
30
30
31
31
def test_update (self ):
32
+
33
+ # Save the content of the header file for later
34
+ old_header = open (self .header , "r" )
35
+ content = old_header .read ()
36
+ old_header .close ()
37
+
32
38
declarations = parser .parse ([self .header ], self .config )
33
39
cache = parser .file_cache_t (self .cache_file )
34
40
cache .update (
@@ -46,6 +52,13 @@ def test_update(self):
46
52
cache .cached_value (self .header , self .config ) is None ,
47
53
"cache didn't recognize that some files on disk has been changed" )
48
54
55
+ # We wrote a //touch in the header file. Just replace the file with the
56
+ # original content. The touched file would be sometimes commited by error
57
+ # as it was modified.
58
+ new_header = open (self .header , "w" )
59
+ new_header .write (content )
60
+ new_header .close ()
61
+
49
62
def test_from_file (self ):
50
63
declarations = parser .parse ([self .header ], self .config )
51
64
cache = parser .file_cache_t (self .cache_file )
You can’t perform that action at this time.
0 commit comments