Exemple #1
0
 def test_parse_url_fail(self):
     testcases = [
         'github.com/mingrammer/sorting/useless', 'github.com/django/'
     ]
     for tc in testcases:
         with self.assertRaises(Exception):
             parse_url(tc)
Exemple #2
0
 def test_parse_url_fail(self):
     testcases = [
         'github.com/mingrammer/sorting/useless',
         'github.com/django/'
     ]
     for tc in testcases:
         with self.assertRaises(Exception):
             parse_url(tc)
Exemple #3
0
def check():
    url = request.form['url']
    try:
        parse_url(url)
        return redirect(url_for('report', repo_url=url))
    except:
        flash('Given repository url is not valid')
        return redirect(url_for('index'))
Exemple #4
0
 def test_parse_url(self):
     testcases = [{
         'url': 'github.com/mingrammer/awesome-finder',
         'name': 'awesome-finder',
         'username': '******'
     }, {
         'url': 'github.com/django/django',
         'name': 'django',
         'username': '******'
     }]
     for tc in testcases:
         username, name = parse_url(tc['url'])
         self.assertEqual(name, tc['name'])
         self.assertEqual(username, tc['username'])
Exemple #5
0
 def test_parse_url(self):
     testcases = [
         {
             'url': 'github.com/mingrammer/sorting',
             'name': 'sorting',
             'username': '******'
         },
         {
             'url': 'github.com/django/django',
             'name': 'django',
             'username': '******'
         }
     ]
     for tc in testcases:
         username, name = parse_url(tc['url'])
         self.assertEqual(name, tc['name'])
         self.assertEqual(username, tc['username'])