~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_plugins.py

(lifeless) Changes some tests that compare paths to use a fancier method
 than just string comparison, fixing them on Windows. (Martin [gz])

Show diffs side-by-side

added added

removed removed

Lines of Context:
842
842
        osutils.set_or_unset_env('BZR_PLUGINS_AT', 'test_foo@non-standard-dir')
843
843
        plugin.load_plugins(['standard'])
844
844
        self.assertTestFooLoadedFrom('non-standard-dir')
845
 
        self.assertEqual('non-standard-dir/__init__.py',
846
 
                         bzrlib.plugins.test_foo.__file__)
 
845
        self.assertIsSameRealPath('non-standard-dir/__init__.py',
 
846
                                  bzrlib.plugins.test_foo.__file__)
847
847
 
848
848
        # Try importing again now that the source has been compiled
849
849
        self._unregister_plugin('test_foo')
854
854
            suffix = 'pyc'
855
855
        else:
856
856
            suffix = 'pyo'
857
 
        self.assertEqual('non-standard-dir/__init__.%s' % suffix,
858
 
                         bzrlib.plugins.test_foo.__file__)
 
857
        self.assertIsSameRealPath('non-standard-dir/__init__.%s' % suffix,
 
858
                                  bzrlib.plugins.test_foo.__file__)
859
859
 
860
860
    def test_submodule_loading(self):
861
861
        # We create an additional directory under the one for test_foo
866
866
        self.assertEqual('bzrlib.plugins.test_foo',
867
867
                         bzrlib.plugins.test_foo.__package__)
868
868
        import bzrlib.plugins.test_foo.test_bar
869
 
        self.assertEqual('non-standard-dir/test_bar/__init__.py',
870
 
                         bzrlib.plugins.test_foo.test_bar.__file__)
 
869
        self.assertIsSameRealPath('non-standard-dir/test_bar/__init__.py',
 
870
                                  bzrlib.plugins.test_foo.test_bar.__file__)
871
871
 
872
872
    def test_loading_from___init__only(self):
873
873
        # We rename the existing __init__.py file to ensure that we don't load