# coding=utf-8
import os
import pytest
import helpers


@pytest.mark.skipif("CHINA" in os.environ, reason="")
@pytest.mark.parametrize('shortened, original', [
    ('https://git.io/vyDZv', 'https://charcoal-se.org/smokey/'),
    ('https://bit.ly/2jhMbxn', 'https://charcoal-se.org/'),
    ('https://tinyurl.com/y7ba4pth', 'https://charcoal-se.org/'),
    ('https://tiny.cc/gsbbpy', 'https://charcoal-se.org/')
])
def test_unshorten_link(shortened, original):
    assert helpers.unshorten_link(shortened) == original

# coding=utf-8
import os
import pytest
import helpers


@pytest.mark.skipif("CHINA" in os.environ, reason="")
@pytest.mark.parametrize('shortened, original', [
    ('https://git.io/vyDZv', 'https://charcoal-se.org/smokey/'),
    ('https://bit.ly/2jhMbxn', 'https://charcoal-se.org/'),
    ('https://tinyurl.com/y7ba4pth', 'https://charcoal-se.org/')
    # https://tiny.cc/gsbbpy is not resolving on some hosts.
    # Notably, it does not resolve on CircleCI, but does on Travis CI.
    # It also resolves from Makyen's Windows machine, but not from Makyen's EC2-Linux.
    # ('https://tiny.cc/gsbbpy', 'https://charcoal-se.org/')
])
def test_unshorten_link(shortened, original):
    assert helpers.unshorten_link(shortened) == original

Comment out https://tiny.cc/gsbbpy -autopull This problem appears to be only on some hosts. Somethings been wrong with getting the redirected URL from https://tiny.cc/gsbbpy for the last 8 days, or so. It started failing at [this CI](https://circleci.com/gh/Charcoal-SE/SmokeDetector/58684), which was just a typical !!/blacklist-website command. The commit is [here](https://github.com/Charcoal-SE/SmokeDetector/commit/236669b20157307080886b575e440389ea6f8a54) Resolution doesn't work when tried from CircleCI or my EC2 instance. However, it does work from Travis CI and my Windows machine.