@@ -591,6 +591,10 @@ def test_ensure_exists(self):
591
591
def test_export (self ):
592
592
"""Test exporting of revisions."""
593
593
with TemporaryDirectory () as directory :
594
+ # Change the current working directory to our temporary directory
595
+ # so that we can give a relative pathname to export(). This is a
596
+ # regression test for a bug to be fixed in vcs-repo-mgr 4.1.3.
597
+ os .chdir (directory )
594
598
# Initialize a repository object of the parametrized type.
595
599
repository = self .get_instance (bare = False , local = os .path .join (directory , 'repo' ))
596
600
repository .create ()
@@ -604,17 +608,20 @@ def test_export(self):
604
608
message = "Initial commit" ,
605
609
)
606
610
# Export the initial revision.
607
- export_directory = os .path .join (directory , 'export' )
611
+ export_directory_relative = 'export'
612
+ export_directory_absolute = os .path .join (directory , export_directory_relative )
608
613
returncode , output = run_cli (
609
614
main , '--repository=%s' % repository .local ,
610
- '--export=%s' % export_directory ,
615
+ '--export=%s' % export_directory_relative ,
611
616
)
612
617
self .assertEquals (returncode , 0 )
613
618
# Check that the file we committed was exported.
614
- exported_file = os .path .join (export_directory , versioned_filename )
619
+ exported_file = os .path .join (export_directory_absolute , versioned_filename )
615
620
self .assertTrue (os .path .isfile (exported_file ))
616
621
with codecs .open (exported_file , 'r' , 'UTF-8' ) as handle :
617
622
self .assertEquals (handle .read (), versioned_contents )
623
+ # Reset the working directory.
624
+ os .chdir (tempfile .gettempdir ())
618
625
619
626
def test_find_revision_number (self ):
620
627
"""Test querying the command line interface for local revision numbers."""
0 commit comments