<commit_before>package anaconda_test

import (
	"net/url"
	"reflect"
	"testing"

	"github.com/ChimeraCoder/anaconda"
)

func TestOEmbed(t *testing.T) {
	// It is the only one that can be tested without auth
	api := anaconda.NewTwitterApi("", "")
	o, err := api.GetOEmbed(url.Values{"id": []string{"99530515043983360"}})
	if err != nil {
		t.Error(err)
	}

	if !reflect.DeepEqual(o, expectedOEmbed) {
		t.Error("Actual OEmbed differs from expected", o)
	}
}

var expectedOEmbed anaconda.OEmbed = anaconda.OEmbed{
	Cache_age:     "3153600000",
	Url:           "https://twitter.com/twitter/statuses/99530515043983360",
	Height:        0,
	Provider_url:  "https://twitter.com",
	Provider_name: "Twitter",
	Author_name:   "Twitter",
	Version:       "1.0",
	Author_url:    "https://twitter.com/twitter",
	Type:          "rich",
	Html:          "\u003Cblockquote class=\"twitter-tweet\"\u003E\u003Cp\u003ECool! \u201C\u003Ca href=\"https://twitter.com/tw1tt3rart\"\u003E@tw1tt3rart\u003C/a\u003E: \u003Ca href=\"https://twitter.com/hashtag/TWITTERART?src=hash\"\u003E#TWITTERART\u003C/a\u003E \u2571\u2571\u2571\u2571\u2571\u2571\u2571\u2571 \u2571\u2571\u256D\u2501\u2501\u2501\u2501\u256E\u2571\u2571\u256D\u2501\u2501\u2501\u2501\u256E \u2571\u2571\u2503\u2587\u2506\u2506\u2587\u2503\u2571\u256D\u252B\u24E6\u24D4\u24D4\u24DA\u2503 \u2571\u2571\u2503\u25BD\u25BD\u25BD\u25BD\u2503\u2501\u256F\u2503\u2661\u24D4\u24DD\u24D3\u2503 \u2571\u256D\u252B\u25B3\u25B3\u25B3\u25B3\u2523\u256E\u2571\u2570\u2501\u2501\u2501\u2501\u256F \u2571\u2503\u2503\u2506\u2506\u2506\u2506\u2503\u2503\u2571\u2571\u2571\u2571\u2571\u2571 \u2571\u2517\u252B\u2506\u250F\u2513\u2506\u2523\u251B\u2571\u2571\u2571\u2571\u2571\u201D\u003C/p\u003E&mdash; Twitter (@twitter) \u003Ca href=\"https://twitter.com/twitter/status/99530515043983360\"\u003EAugust 5, 2011\u003C/a\u003E\u003C/blockquote\u003E\n\u003Cscript async src=\"//platform.twitter.com/widgets.js\" charset=\"utf-8\"\u003E\u003C/script\u003E",
	Width:         550,
}<commit_msg>test(TestOEmbed): fix test to make it pass<commit_after>package anaconda_test

import (
	"net/url"
	"reflect"
	"testing"

	"github.com/ChimeraCoder/anaconda"
)

func TestOEmbed(t *testing.T) {
	// It is the only one that can be tested without auth
	api := anaconda.NewTwitterApi("", "")
	o, err := api.GetOEmbed(url.Values{"id": []string{"99530515043983360"}})
	if err != nil {
		t.Error(err)
	}

	if !reflect.DeepEqual(o, expectedOEmbed) {
		t.Errorf("Actual OEmbed differs expected:\n%+v\n Got: \n%+v\n", expectedOEmbed, o)
	}
}

var expectedOEmbed anaconda.OEmbed = anaconda.OEmbed{
	Cache_age:     "3153600000",
	Url:           "https://twitter.com/twitter/statuses/99530515043983360",
	Height:        0,
	Provider_url:  "https://twitter.com",
	Provider_name: "Twitter",
	Author_name:   "Twitter",
	Version:       "1.0",
	Author_url:    "https://twitter.com/twitter",
	Type:          "rich",
	Html: `<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Cool! “<a href="https://twitter.com/tw1tt3rart">@tw1tt3rart</a>: <a href="https://twitter.com/hashtag/TWITTERART?src=hash">#TWITTERART</a> ╱╱╱╱╱╱╱╱ ╱╱╭━━━━╮╱╱╭━━━━╮ ╱╱┃▇┆┆▇┃╱╭┫ⓦⓔⓔⓚ┃ ╱╱┃▽▽▽▽┃━╯┃♡ⓔⓝⓓ┃ ╱╭┫△△△△┣╮╱╰━━━━╯ ╱┃┃┆┆┆┆┃┃╱╱╱╱╱╱ ╱┗┫┆┏┓┆┣┛╱╱╱╱╱”</p>&mdash; Twitter (@twitter) <a href="https://twitter.com/twitter/status/99530515043983360">August 5, 2011</a></blockquote>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>`,
	Width: 550,
}
{'fraction_non_alphanumeric': 0.1977926227127505, 'fraction_numerical': 0.1745570723206506, 'mean_word_length': 4.406593406593407, 'pattern_counts': {'":': 2, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2587824', 'n_tokens_mistral': 2097, 'n_tokens_neox': 1693, 'n_words': 185}