Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
package_control_channel
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gaurav Kukreja
package_control_channel
Commits
5d8b4d55
Commit
5d8b4d55
authored
Jul 17, 2013
by
Alessandro Fragnani
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master'
Conflicts: repositories.json
parents
ae6dbbfd
6b932d21
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
460 additions
and
66 deletions
+460
-66
.travis.yml
.travis.yml
+1
-1
repositories.json
repositories.json
+431
-50
test.py
tests/test.py
+28
-15
No files found.
.travis.yml
View file @
5d8b4d55
language
:
python
language
:
python
python
:
python
:
-
"
2.7
"
-
"
3.3
"
#command to run tests
#command to run tests
script
:
nosetests
script
:
nosetests
repositories.json
View file @
5d8b4d55
This diff is collapsed.
Click to expand it.
tests/test.py
View file @
5d8b4d55
import
json
import
json
import
unittest
from
collections
import
OrderedDict
from
collections
import
OrderedDict
def
test_json_is_valid
():
# Only run these using `notetests` (or `python -m unittest`) from the root directory
fp
=
open
(
"repositories.json"
)
json
.
load
(
fp
)
def
test_repositories_in_order
():
j
=
json
.
load
(
open
(
"repositories.json"
))
repos
=
j
[
'repositories'
][
3
:]
assert
repos
==
sorted
(
repos
,
key
=
unicode
.
lower
)
def
test_package_names_in_order
():
# No need to check for this because all the other tests would fail anyway
j
=
json
.
load
(
open
(
"repositories.json"
),
object_pairs_hook
=
OrderedDict
)
# class TestValidity(unittest.TestCase):
packages
=
j
[
'package_name_map'
]
.
keys
()
# def test_json_is_valid(self):
assert
packages
==
sorted
(
packages
,
key
=
unicode
.
lower
)
# fp = open("repositories.json")
# json.load(fp)
def
test_renamed_packages_in_order
():
j
=
json
.
load
(
open
(
"repositories.json"
),
object_pairs_hook
=
OrderedDict
)
class
TestOrder
(
unittest
.
TestCase
):
packages
=
j
[
'renamed_packages'
]
.
keys
()
# Do not limit the list comparison to 600 chars (for more detailed debugging)
assert
packages
==
sorted
(
packages
,
key
=
unicode
.
lower
)
maxDiff
=
None
def
setUp
(
self
):
self
.
j
=
json
.
load
(
open
(
"repositories.json"
),
object_pairs_hook
=
OrderedDict
)
def
test_repositories_in_order
(
self
):
repos
=
self
.
j
[
'repositories'
]
# Remove "https://github.com/SublimeText" at the top because it is purposely not in order
del
repos
[
0
]
self
.
assertEqual
(
repos
,
sorted
(
repos
,
key
=
str
.
lower
))
def
test_package_names_in_order
(
self
):
map_packages
=
list
(
self
.
j
[
'package_name_map'
]
.
keys
())
self
.
assertEqual
(
map_packages
,
sorted
(
map_packages
,
key
=
str
.
lower
))
def
test_renamed_packages_in_order
(
self
):
ren_packages
=
list
(
self
.
j
[
'renamed_packages'
]
.
keys
())
self
.
assertEqual
(
ren_packages
,
sorted
(
ren_packages
,
key
=
str
.
lower
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment