Esempio n. 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)
Esempio n. 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)
Esempio n. 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'))
Esempio n. 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'])
Esempio n. 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'])