# Path: ghtools/identifier.py
# class Identifier(_Identifier):
#     """
# 
#     A simple identifier of an object in the GitHub API, usually created from a
#     string passed in on the command line.
# 
#     Users can reference a repository on a specific GitHub using the form::
# 
#         <github_name>:<org_name>/<repo_name>
# 
#     Where ``github_name`` is optional (defaulting to 'public').
# 
#     The repository can also be omitted in order to refer to an Organisation::
# 
#         <github_name>:<org_name>
# 
#     Again, ``github_name`` is optional.
# 
#     """
# 
#     @classmethod
#     def from_string(cls, identstring):
# 
#         parts = identstring.split(':', 1)
# 
#         if len(parts) == 1:
#             github = DEFAULT_GITHUB
#             remainder = parts[0]
#         else:
#             github, remainder = parts
# 
#         parts = remainder.split('/', 1)
# 
#         if len(parts) == 1:
#             org = parts[0]
#             repo = None
#         else:
#             org, repo = parts
# 
#         return Identifier(github, org, repo)
# 
#     def __str__(self):
#         out = ''
#         if self.github != DEFAULT_GITHUB:
#             out += self.github + ':'
#         out += self.org
#         if self.repo is not None:
#             out += '/{0}'.format(self.repo)
#         return out


from ..helpers import *
from ghtools.identifier import Identifier
        assert_equal(i.org, 'myorg')
        assert_equal(i.repo, None)

    def test_explicit_org(self):
        i = Identifier.from_string('foo:myorg')
        assert_equal(i.github, 'foo')
        assert_equal(i.org, 'myorg')
        assert_equal(i.repo, None)

    def test_implicit_repo(self):
        i = Identifier.from_string('myorg/myrepo')
        assert_equal(i.github, 'public')
        assert_equal(i.org, 'myorg')
        assert_equal(i.repo, 'myrepo')

    def test_explicit_repo(self):
        i = Identifier.from_string('foo:myorg/myrepo')
        assert_equal(i.github, 'foo')
        assert_equal(i.org, 'myorg')
        assert_equal(i.repo, 'myrepo')

    def test_str(self):
        i = Identifier.from_string('foo:myorg/myrepo')
        assert_equal(str(i), 'foo:myorg/myrepo')

    def test_str_public(self):
        i = Identifier.from_string('myorg/myrepo')
        assert_equal(str(i), 'myorg/myrepo')

    def test_str_repoless(self):

# Path: ghtools/identifier.py
# class Identifier(_Identifier):
#     """
# 
#     A simple identifier of an object in the GitHub API, usually created from a
#     string passed in on the command line.
# 
#     Users can reference a repository on a specific GitHub using the form::
# 
#         <github_name>:<org_name>/<repo_name>
# 
#     Where ``github_name`` is optional (defaulting to 'public').
# 
#     The repository can also be omitted in order to refer to an Organisation::
# 
#         <github_name>:<org_name>
# 
#     Again, ``github_name`` is optional.
# 
#     """
# 
#     @classmethod
#     def from_string(cls, identstring):
# 
#         parts = identstring.split(':', 1)
# 
#         if len(parts) == 1:
#             github = DEFAULT_GITHUB
#             remainder = parts[0]
#         else:
#             github, remainder = parts
# 
#         parts = remainder.split('/', 1)
# 
#         if len(parts) == 1:
#             org = parts[0]
#             repo = None
#         else:
#             org, repo = parts
# 
#         return Identifier(github, org, repo)
# 
#     def __str__(self):
#         out = ''
#         if self.github != DEFAULT_GITHUB:
#             out += self.github + ':'
#         out += self.org
#         if self.repo is not None:
#             out += '/{0}'.format(self.repo)
#         return out


# Path: test/unit/test_identifier.py
from ..helpers import *
from ghtools.identifier import Identifier

        assert_equal(i.org, 'myorg')
        assert_equal(i.repo, None)

    def test_explicit_org(self):
        i = Identifier.from_string('foo:myorg')
        assert_equal(i.github, 'foo')
        assert_equal(i.org, 'myorg')
        assert_equal(i.repo, None)

    def test_implicit_repo(self):
        i = Identifier.from_string('myorg/myrepo')
        assert_equal(i.github, 'public')
        assert_equal(i.org, 'myorg')
        assert_equal(i.repo, 'myrepo')

    def test_explicit_repo(self):
        i = Identifier.from_string('foo:myorg/myrepo')
        assert_equal(i.github, 'foo')
        assert_equal(i.org, 'myorg')
        assert_equal(i.repo, 'myrepo')

    def test_str(self):
        i = Identifier.from_string('foo:myorg/myrepo')
        assert_equal(str(i), 'foo:myorg/myrepo')

    def test_str_public(self):
        i = Identifier.from_string('myorg/myrepo')
        assert_equal(str(i), 'myorg/myrepo')

    def test_str_repoless(self):

        i = Identifier.from_string('foo:myorg')