Skip to content

Commit

Permalink
Fix the dulwich test to not make remote requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
metatoaster committed Aug 2, 2024
1 parent 0946a81 commit 694efa2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Changelog
0.7.0 - 2024-08-02
------------------

- Provide subclasses of workspaces that allow credentials be provided
for accessing private workspaces.
- Provide subclasses of existing commmands that allow credentials be
provided for accessing private workspaces.

0.6.0 - 2023-10-17
------------------
Expand Down
15 changes: 15 additions & 0 deletions tests/test_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,21 @@ def _ls_root(self, workspace=None):
def test_get_cmd_by_name(self):
self.assertEqual(get_cmd_by_name('dulwich'), self.cmdcls)

# the following two tests mostly here for coverage purposes.
# as they don't connect to real repositories.

def test_push_url_with_creds(self):
workspace = CmdWorkspace(self.workspace_dir, self.cmd)
_, _, code = self.cmd.push(
workspace, username='username', password='password')
self.assertEqual(code, 1)

def test_pull_url_with_creds(self):
workspace = CmdWorkspace(self.workspace_dir, self.cmd)
_, _, code = self.cmd.pull(
workspace, username='username', password='password')
self.assertEqual(code, 1)


@skipIf(not AuthenticatedGitDvcsCmd.available(), 'git is not available')
class AuthenticatedGitDvcsCmdTestCase(GitDvcsCmdTestCase):
Expand Down

0 comments on commit 694efa2

Please sign in to comment.