Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/runall.py28
-rw-r--r--tests/lib/test_mime.py81
2 files changed, 0 insertions, 109 deletions
diff --git a/tests/lib/runall.py b/tests/lib/runall.py
deleted file mode 100644
index ae1bb3a..0000000
--- a/tests/lib/runall.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright (C) 2007, Red Hat, Inc.
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the
-# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-import unittest
-
-import test_mime
-
-runner = unittest.TextTestRunner()
-loader = unittest.TestLoader()
-
-suite = unittest.TestSuite()
-suite.addTest(loader.loadTestsFromModule(test_mime))
-
-runner.run(suite)
diff --git a/tests/lib/test_mime.py b/tests/lib/test_mime.py
deleted file mode 100644
index 3df0ce6..0000000
--- a/tests/lib/test_mime.py
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (C) 2006, Red Hat, Inc.
-# Copyright (C) 2007, One Laptop Per Child
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-import sys
-import unittest
-
-from sugar import mime
-
-class TestMime(unittest.TestCase):
- def test_from_file_name(self):
- self.assertEqual(mime.get_from_file_name('test.pdf'),
- 'application/pdf')
-
- def test_choose_most_significant(self):
- # Mozilla's text in dnd
- mime_type = mime.choose_most_significant(
- ['text/plain', 'text/_moz_htmlcontext', 'text/unicode',
- 'text/html', 'text/_moz_htmlinfo'])
- self.assertEqual(mime_type, 'text/html')
-
- # Mozilla's text in c&v
- mime_type = mime.choose_most_significant(
- ['text/_moz_htmlcontext', 'STRING', 'text/html', 'text/_moz_htmlinfo',
- 'text/x-moz-url-priv', 'UTF8_STRING', 'COMPOUND_TEXT'])
- self.assertEqual(mime_type, 'text/html')
-
- # Mozilla gif in dnd
- mime_type = mime.choose_most_significant(
- ['application/x-moz-file-promise-url',
- 'application/x-moz-file-promise-dest-filename', 'text/_moz_htmlinfo',
- 'text/x-moz-url-desc', 'text/_moz_htmlcontext', 'text/x-moz-url-data',
- 'text/uri-list'])
- self.assertEqual(mime_type, 'text/uri-list')
-
- # Mozilla url in dnd
- mime_type = mime.choose_most_significant(
- ['text/_moz_htmlcontext', 'text/html', 'text/_moz_htmlinfo',
- '_NETSCAPE_URL', 'text/x-moz-url', 'text/x-moz-url-desc',
- 'text/x-moz-url-data', 'text/plain', 'text/unicode'])
- self.assertEqual(mime_type, 'text/x-moz-url')
-
- # Abiword text in dnd
- mime_type = mime.choose_most_significant(
- ['text/rtf', 'text/uri-list'])
- self.assertEqual(mime_type, 'text/uri-list')
-
- # Abiword text in c&v
- mime_type = mime.choose_most_significant(
- ['UTF8_STRING', 'STRING', 'text/html', 'TEXT', 'text/rtf',
- 'COMPOUND_TEXT', 'application/rtf', 'text/plain',
- 'application/xhtml+xml'])
- self.assertEqual(mime_type, 'application/rtf')
-
- # Abiword text in c&v
- mime_type = mime.choose_most_significant(
- ['GTK_TEXT_BUFFER_CONTENTS',
- 'application/x-gtk-text-buffer-rich-text',
- 'UTF8_STRING', 'COMPOUND_TEXT', 'TEXT', 'STRING',
- 'text/plain;charset=utf-8', 'text/plain;charset=UTF-8',
- 'text/plain'])
- self.assertEqual(mime_type, 'text/plain')
-
-if __name__ == "__main__":
- unittest.main()
-