def test_kmeans(): clusters = kmeans.s(2).delay(DOCS).get() assert_equal(len(clusters), len(DOCS)) assert_equal(set([0, 1]), set(clusters)) clusters = big_kmeans.s(2).delay(DOCS).get() assert_equal(len(clusters), len(DOCS)) assert_equal(set([0, 1]), set(clusters))
def test_kmeans(): clusters = kmeans.s(2).delay(DOCS).get() assert_equal(len(clusters), 2) assert_equal(DOCS, sorted(clusters[0] + clusters[1])) clusters = big_kmeans.s(3).delay(DOCS).get() assert_equal(len(clusters), 3) assert_equal(DOCS, sorted(clusters[0] + clusters[1] + clusters[2]))