Skip to content

Commit

Permalink
add test script for new rosdistro files, prevent sort_yaml to run on …
Browse files Browse the repository at this point in the history
…new files
  • Loading branch information
dirk-thomas committed Apr 22, 2013
1 parent 0e89524 commit 5223ef1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/sort_yaml.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
#!/usr/bin/env python

from __future__ import print_function

import argparse
import sys
import yaml


def sort_yaml(yaml_file):
data = yaml.load(open(yaml_file, 'r'))
if 'version' in data:
print('This script does not support the new rosdistro yaml files', file=sys.stderr)
sys.exit(1)
sort_yaml_data(data)
yaml.dump(data, file(yaml_file, 'w'), default_flow_style=False)

Expand Down
10 changes: 10 additions & 0 deletions test/rosdistro_verify.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import os

from rosdistro.verify import verify_files_identical

FILES_DIR = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))


def test_verify_files_identical():
index_url = 'file:https://' + FILES_DIR + '/index.yaml'
assert verify_files_identical(index_url)

0 comments on commit 5223ef1

Please sign in to comment.