-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from moreonion/patched-d.o
Allow patched drupal.org projects.
- Loading branch information
Showing
3 changed files
with
67 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
language: python | ||
python: | ||
- "3.4" | ||
install: python setup.py install | ||
script: py.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from unittest import TestCase | ||
|
||
from drupy.objects import DrupalOrgProject | ||
|
||
|
||
class DrupalOrgProjectTest(TestCase): | ||
|
||
def test_split_project(self): | ||
assert DrupalOrgProject.split_project('campaignion-7.x-1.5+pr32') == \ | ||
('campaignion', '7.x', '1.5', ('pr32', )) | ||
assert DrupalOrgProject.split_project('campaignion-7.x-1.0-rc1') == \ | ||
('campaignion', '7.x', '1.0-rc1', tuple()) | ||
|
||
def test_is_valid(self): | ||
# Valid package spec without declaring type. | ||
p = DrupalOrgProject(None, dict(dirname='campaignion-7.x-1.0')) | ||
assert p.isValid() | ||
|
||
# Invalid package spec but declaring type. | ||
p = DrupalOrgProject(None, dict( | ||
dirname='testitt', | ||
build=[{}], | ||
type='drupal.org', | ||
)) | ||
assert p.isValid() | ||
|
||
# Invalid package spec without declaring type. | ||
p = DrupalOrgProject(None, dict(dirname='testitt')) | ||
assert not p.isValid() |