<commit_before>package org.biojava.bio.structure;

import org.biojava.bio.structure.io.mmcif.ChemCompGroupFactory;
import org.biojava.bio.structure.io.mmcif.chem.PolymerType;
import org.biojava.bio.structure.io.mmcif.chem.ResidueType;
import org.biojava.bio.structure.io.mmcif.model.ChemComp;

import junit.framework.TestCase;

public class ChemCompTest extends TestCase {

	public void testALA(){
		String chemID = "ALA";

		ChemComp cc = ChemCompGroupFactory.getChemComp(chemID);

		assertNotNull(cc.getPolymerType());

		assertEquals(cc.getPolymerType(), PolymerType.peptide);

		assertNotNull("residue type has not been set!", cc.getResidueType());

		assertTrue (" is not amino ", cc.getResidueType().equals(ResidueType.lPeptideLinking));
	}

	public void testMEA(){
		String chemID = "MEA";
		
//		DownloadChemCompProvider all = new DownloadChemCompProvider();
//		all.setDownloadAll(true);
//		
//		ChemCompGroupFactory.setChemCompProvider(all);

		ChemComp cc = ChemCompGroupFactory.getChemComp(chemID);

		assertNotNull(cc);
		
		assertTrue(" is not mea" , cc.getId().equals(chemID));

		assertEquals(" one letter code is not correct", cc.getOne_letter_code(),"F");

		assertEquals(cc.getThree_letter_code(),"MEA");

		assertNotNull(cc.getPolymerType());

		assertEquals(cc.getPolymerType(), PolymerType.peptide);

		assertNotNull("residue type has not been set!", cc.getResidueType());

		assertTrue (" is not amino ", cc.getResidueType().equals(ResidueType.lPeptideLinking));

		Group g = ChemCompGroupFactory.getGroupFromChemCompDictionary(chemID);

		assertTrue( g.getType().equals("amino"));
<commit_msg>working around the no-download chem comp provider.<commit_after>package org.biojava.bio.structure;

import org.biojava.bio.structure.io.mmcif.ChemCompGroupFactory;
import org.biojava.bio.structure.io.mmcif.ChemCompProvider;
import org.biojava.bio.structure.io.mmcif.DownloadChemCompProvider;
import org.biojava.bio.structure.io.mmcif.chem.PolymerType;
import org.biojava.bio.structure.io.mmcif.chem.ResidueType;
import org.biojava.bio.structure.io.mmcif.model.ChemComp;

import junit.framework.TestCase;

public class ChemCompTest extends TestCase {

	public void testALA(){
		String chemID = "ALA";

		ChemComp cc = ChemCompGroupFactory.getChemComp(chemID);

		assertNotNull(cc.getPolymerType());

		assertEquals(cc.getPolymerType(), PolymerType.peptide);

		assertNotNull("residue type has not been set!", cc.getResidueType());

		assertTrue (" is not amino ", cc.getResidueType().equals(ResidueType.lPeptideLinking));
	}

	public void testMEA(){
		
		
		String chemID = "MEA";
		
		ChemCompProvider oldProvider = ChemCompGroupFactory.getChemCompProvider();
		
		DownloadChemCompProvider all = new DownloadChemCompProvider();
		//all.setDownloadAll(true);
		
		ChemCompGroupFactory.setChemCompProvider(all);

		ChemComp cc = ChemCompGroupFactory.getChemComp(chemID);

		assertNotNull(cc);
		
		assertTrue(" is not mea" , cc.getId().equals(chemID));

		assertEquals(" one letter code is not correct", cc.getOne_letter_code(),"F");

		assertEquals(cc.getThree_letter_code(),"MEA");

		assertNotNull(cc.getPolymerType());

		assertEquals(cc.getPolymerType(), PolymerType.peptide);

		assertNotNull("residue type has not been set!", cc.getResidueType());

		assertTrue (" is not amino ", cc.getResidueType().equals(ResidueType.lPeptideLinking));

		Group g = ChemCompGroupFactory.getGroupFromChemCompDictionary(chemID);

		assertTrue( g.getType().equals("amino"));

		ChemCompGroupFactory.setChemCompProvider(oldProvider);
{'fraction_non_alphanumeric': 0.12577727529677785, 'fraction_numerical': 0.0, 'mean_word_length': 5.740952380952381, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4156499', 'n_tokens_mistral': 1236, 'n_tokens_neox': 1099, 'n_words': 196}