Show More
@@ -407,31 +407,33 b' class TestCreateFilesUrl(object):' | |||
|
407 | 407 | controller = summary.SummaryController() |
|
408 | 408 | repo = mock.Mock() |
|
409 | 409 | repo.name = 'abcde' |
|
410 | full_repo_name = 'test-repo-group/' + repo.name | |
|
410 | 411 | ref_name = 'branch1' |
|
411 | 412 | raw_id = 'deadbeef0123456789' |
|
412 | 413 | is_svn = False |
|
413 | 414 | |
|
414 | 415 | with mock.patch.object(summary.h, 'url') as url_mock: |
|
415 | 416 | result = controller._create_files_url( |
|
416 | repo, ref_name, raw_id, is_svn) | |
|
417 | repo, full_repo_name, ref_name, raw_id, is_svn) | |
|
417 | 418 | url_mock.assert_called_once_with( |
|
418 |
'files_home', repo_name= |
|
|
419 | at=ref_name) | |
|
419 | 'files_home', repo_name=full_repo_name, f_path='', | |
|
420 | revision=ref_name, at=ref_name) | |
|
420 | 421 | assert result == url_mock.return_value |
|
421 | 422 | |
|
422 | 423 | def test_creates_svn_url(self): |
|
423 | 424 | controller = summary.SummaryController() |
|
424 | 425 | repo = mock.Mock() |
|
425 | 426 | repo.name = 'abcde' |
|
427 | full_repo_name = 'test-repo-group/' + repo.name | |
|
426 | 428 | ref_name = 'branch1' |
|
427 | 429 | raw_id = 'deadbeef0123456789' |
|
428 | 430 | is_svn = True |
|
429 | 431 | |
|
430 | 432 | with mock.patch.object(summary.h, 'url') as url_mock: |
|
431 | 433 | result = controller._create_files_url( |
|
432 | repo, ref_name, raw_id, is_svn) | |
|
434 | repo, full_repo_name, ref_name, raw_id, is_svn) | |
|
433 | 435 | url_mock.assert_called_once_with( |
|
434 |
'files_home', repo_name= |
|
|
436 | 'files_home', repo_name=full_repo_name, f_path=ref_name, | |
|
435 | 437 | revision=raw_id, at=ref_name) |
|
436 | 438 | assert result == url_mock.return_value |
|
437 | 439 | |
@@ -439,15 +441,16 b' class TestCreateFilesUrl(object):' | |||
|
439 | 441 | controller = summary.SummaryController() |
|
440 | 442 | repo = mock.Mock() |
|
441 | 443 | repo.name = 'abcde' |
|
444 | full_repo_name = 'test-repo-group/' + repo.name | |
|
442 | 445 | ref_name = 'branch1/branch2' |
|
443 | 446 | raw_id = 'deadbeef0123456789' |
|
444 | 447 | is_svn = False |
|
445 | 448 | |
|
446 | 449 | with mock.patch.object(summary.h, 'url') as url_mock: |
|
447 | 450 | result = controller._create_files_url( |
|
448 | repo, ref_name, raw_id, is_svn) | |
|
451 | repo, full_repo_name, ref_name, raw_id, is_svn) | |
|
449 | 452 | url_mock.assert_called_once_with( |
|
450 |
'files_home', repo_name= |
|
|
453 | 'files_home', repo_name=full_repo_name, f_path='', revision=raw_id, | |
|
451 | 454 | at=ref_name) |
|
452 | 455 | assert result == url_mock.return_value |
|
453 | 456 |
General Comments 0
You need to be logged in to leave comments.
Login now